2
« on: August 19, 2014, 07:42:46 pm »
Hello,
I am new to using ParamQuery Pro. I'm having trouble setting/changing the contents of row data dynamically. My grid has 7 Columns:
ItemName (DropDownList editor),
LineDesc,
ClassName (DropDownList editor),
UnitPrice (datatype:float),
Quantity (datatype:integer),
ExtendedAmount (datatype:float, editable=false) -- this is a computed column based on UnitPrice & Quantity,
Tax (DropDownList editor)
When an Item is selected in ItemName, I want to populate the remaining columns from my JSON data. I am using the cellSave event as follows:
cellSave: function (evt, ui) {
var dataIndx = ui.dataIndx;
var rowIndx = ui.rowIndx;
if (dataIndx == 'ItemName') {
var id = $('.itemsListData').val();
$.each(itemsJson, function (i, val) {
if (val.ItemLookupId == id) {
ui.rowData['LineDesc'] = val.LineDesc;
ui.rowData['ClassName'] = val.ClassName;
ui.rowData['UnitPrice'] = val.UnitPrice;
ui.rowData['Quantity'] = val.Quantity;
ui.rowData['ExtendedAmount'] = val.ExtendedAmount (is present in JSON when no UnitPrice given);
ui.rowData['TaxDesc'] = val.TaxDesc;
}
});
}
if (dataIndx == 'Quantity' || dataIndx == 'UnitPrice') {
$grid.pqGrid('refreshCell', { dataIndx: 'ExtendedAmount', rowIndx: rowIndx });
}
}
The LineDesc column works and displays properly, but none of the other columns are displaying. I'm not sure if I am setting the other drop down list editors properly. I also noticed that if I tab to the numeric datatype columns that the value is there in edit mode but does not display on screen. Can you please advise?
Thank you!