ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: Robert on April 18, 2014, 05:46:53 pm
-
Follow up question ...
I would like to access the value of the numberCell from the rowData if that is possible.
This gives me the numberCell object
var num_cell = $grid.pqGrid( "option", "numberCell" );
Is there a way to get the value of a particular row's numberCell something like this:
var num_cell = $grid.pqGrid("getNumberCell", { rowIndx: rowIndx });
-
value of number Cell is equal to rowIndxPage
http://paramquery.com/pro/tutorial#topic-rowIndx
-
Thank you!
-
I am sorry ... I read the tutorial and understand it. However, I am still stuck on the syntax to retrieve the numberCell value.
I get the recID with:
var recID = $grid.pqGrid("getRecId", { rowIndx: rowIndx });
Similar syntax doesn't seem to work for getting the rowIndxPage. I have tried every variation I can think of similar to this:
var num_cell = $grid.pqGrid("option", { rowIndxPage: rowIndxPage });
Suggestons?
-
May I know the context. How did you get rowIndx in the first place? Most of the events supply both rowIndx and rowIndxPage.
var rowIndx = ui.rowIndx;
var rowIndxPage = ui.rowIndxPage;
-
I may not be describing what I am needing very well. I will try to do better here.
This is how I am getting the rowIndex in the first place:
var rowIndx = ui.rowIndx;
Both of the statements get their respective recId numbers just fine:
var recID = $grid.pqGrid("getRecId", { rowIndx: rowIndx });
var recId_page = $grid.pqGrid("getRecId", { rowIndxPage: rowIndxPage });
What I am really looking for is the ability to get the value displayed in the numberCell column (row count), for a particular row, so I can make a comparison against it. I want to be able to catch the last row currently being displayed, regardless of how many pages of rows are in the current dataset. If I could get the values in the numberCell column, that would do it. Is that value available in ether of the following?
var rowData = $grid.pqGrid("getRowData", { rowIndx: rowIndx });
var rowData_page = $grid.pqGrid("getRowData", { rowIndxPage: rowIndxPage });
If so, would have a suggested get for them? If not, could you please suggest an approach for getting that numberCell value OR an alternative?
-
Thank you for helping me fumble my way through this. :D I have figured out from the row selection sample code that this will give me the values I need to do what I want:
obj.rowSelect = function (evt, obj) {
var dataCell = obj.dataModel.data[obj.rowIndx].join(", ");
var rowIndx = parseInt(obj.rowIndx);
}
-
If you are still looking to get the value in numbercell for a specific row,
var numberCellValue = ui.rowIndxPage + 1;
1 is added because rowIndxPage is a zero based index while numberCellValue begins from 1.