ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: rgorantla on September 19, 2014, 08:31:16 pm
-
Hi,
i Have column groups(A ', B) - 1 column in Group A has a radio button - if it is yes then Group B should be grayed out (Users cannot edit or enter any data) , if it is NO then it should be editable.
Is there any group/column property to set the editable property or anything for the above mentioned requirement?
-
Every column has editable property, the callback variant can be used for the above requirement. The value of radio button can be checked in this callback as ui.rowData[ "dataIndx_of_radio_button_column" ] and return true/false accordingly.
http://paramquery.com/pro/api#option-column-editable
-
Thank you , is there any css class to look Gray if editable is false ?
-
For that you have to take help of column.render callback for columns in group B.
In this callback check whether the cell is editable with isEditableCell API
http://paramquery.com/pro/api#method-isEditableCell
If non-editable then add class e.g., grayClass and if editable then remove the class.
And then some css
div.pq-grid tr td.grayClass{
color: gray;
}
-
Hi,
I tried this(below code) in one of the columns in column B - but the class is applied only when the cell is clicked ... But i want all editable cells to be grayed out when i have fundvalue as "FI" ... Any suggestions ?
editable: function (ui) {
if (ui.rowData != undefined) {
var fundvalue = ui.rowData.funding;
if (fundvalue == "FI") {
//console.log(ui);
var ri = ui.rowIndx;
$grid.pqGrid("addClass", { rowIndx: ri, dataIndx: 'adminfeebasis', cls: 'grayClass' });
return false;
}
else {
return true;
}
}
else {
return true;
}
-
Every callback has its own separate purpose.
As mentioned in the previous reply, please add / remove class in the column.render callback. ( not in column.editable )
http://paramquery.com/pro/api#option-column-render
And check this demo for how to add class in the current cell using JSON format
http://paramquery.com/pro/demos/render_cells
-
Hi,
I have written in render callback function - but still unless you are in the column B and click this class is not getting rendered - But i am looking for is if you change value in Column A - these cells need to be grayed out before you going into the cells
render: function (ui) {
var rowix = ui.rowIndx,
dataIndx = ui.dataIndx;
if ($("#medicaltable").pqGrid("isEditableCell", { rowIndx: rowix, dataIndx: dataIndx })) {
$grid.pqGrid("removeClass", { rowIndx: rowix, dataIndx: 'adminfeebasis', cls: 'grayClass' });
}
else {
$grid.pqGrid("addClass", { rowIndx: rowix, dataIndx: 'adminfeebasis', cls: 'grayClass' });
}
},
-
Take help of cellSave or change event to refresh the corresponding cell in column B in same row whenever value in Column A is changed.
-
I Used cellClick - so far it is working the way i want - Thank You so much
-
I'm not sure how you created read only cell with cellClick event. Please check this demo which is relevant to your question
http://paramquery.com/pro/demos/readonly_cells
-
This makes more sense :) - Thank you