To get started, load your Web Apps website in Chrome. Click your F12 key to open developer tools, load your timecard page and select a row. Click over to the ‘Console’
We’ll explore 4 very commonly used functions throughout Web Apps, so you get an idea of what they do.
GetGrid()– just provide the grid name and this will get all the data in the grid and allow you to run some of the following functions.
GetActiveRow()– this gets the active Row of the grid you define; this is often followed by an if test to see if the active row is null because when the grid loses focus, the active row is now considered ‘Last Active Row’ and there is no ‘Active Row’
GetLastActiveRow()– this gets the Last Active Row of whatever grid you defined
GetCellDataAsObject()– this gets the data of a particular grid row as an object. In the way we are using it in the below video, it gets the data of the last active row in the Timecard grid.
We’ll manually run some of the
OnDetailNotes() function to see what they are testing and doing.
First we define a variable ‘grid’ and use
GetGrid(). Then we define a variable activeRow and use the variable ‘grid’ along with the function
GetActiveRow() As you can see, there is no active row, so it returns null. If the active row is null, then we again use the variable ‘grid’ with the function
I went ahead and showed how you can use
GetCellDataAsObject() because I think that’s a very handy tool when debugging. It helps to see if you have the correct data to pass to the Controller. The video below shows the above in action: