ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: rgorantla on October 07, 2014, 02:17:56 am
-
Hi,
i have few columns non-editable based on a condition in a column
When you try to save - it is giving a validation MSG saying required and able to answer that particular cell.
If the cell is non-editable - validations shouldn't work and shouldn't be editable. Validations should work Only if it is editable.
How to make this possible ?
Please help !
-
you can do it by making the cell valid when the cell is non editable.
inside the validation callback, return true when isEditableCell() method returns false.
-
Hi,
I tried but it is still going to that cell. Please see below and tell me what am i doing wrong /correct me please
{
type: function (ui) {
var value = ui.value;
_found = false;
if ($("#medicaltable").pqGrid("isEditableCell", { dataIndx: ui.dataIndx })) {
for (var i = 0; i < adminfees.length; i++) {
if (value.toUpperCase() == adminfees.toUpperCase()) {
_found = true;
break;
}
}
if (!_found) {
ui.msg = value + " not found in list";
ui.value = "Choose One:";
return false;
}
}
else
{
return true;
}
}, icon: 'ui-icon-info'
-
you haven't passed rowIndx to isEditableCell?
-
Ho w do i get rowindx in validation function ... It has only column:column, value:value, rowData:rowData, msg:msg
-
rowIndx can be obtained from rowData by getRowIndx method.
http://paramquery.com/pro/api#method-getRowIndx
-
I put that condition in validation call back , upon saving it is not required - this is working... but the drop downs are still displaying for each non-editable cell :( but not required.... Can we do something to remove the focus or not to display dropdowns for non-editable cells?
-
you can check this on :
Admin fees (columns)
http://jsfiddle.net/rgorantla/Ljd57c1k/1/
-
There are no drop downs in Admin fees columns. Could you please rephrase your question.
-
please see attached image (adminfeecolumns)-
I have similar dropdowns for other columns too (otherdropdowns image) ... when you click save , though these feileds ar enot required still focus is on those dropdowns
-
I checked in both Chrome and IE. Admin Fee Basis is un editable and there is no drop down displayed in that cell. ( similar to otherdropdowns).
Am I missing sth..
-
not really - just click save and drop downs are appearing for me.
When i made editable : true by default - these are resolved too ...