ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: rgorantla on October 07, 2014, 02:17:56 am

Title: Saving
Post 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 !
Title: Re: Saving
Post by: paramvir on October 07, 2014, 11:41:14 pm
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.
Title: Re: Saving
Post by: rgorantla on October 10, 2014, 12:05:20 am
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'

Title: Re: Saving
Post by: paramvir on October 10, 2014, 12:10:14 am
you haven't passed rowIndx to isEditableCell?
Title: Re: Saving
Post by: rgorantla on October 10, 2014, 01:02:27 am
Ho w do i get rowindx in validation function ...  It has only column:column, value:value, rowData:rowData, msg:msg
Title: Re: Saving
Post by: paramvir on October 10, 2014, 07:24:35 am
rowIndx can be obtained from rowData by getRowIndx method.

http://paramquery.com/pro/api#method-getRowIndx
Title: Re: Saving
Post by: rgorantla on October 12, 2014, 01:09:06 am
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?
Title: Re: Saving
Post by: rgorantla on October 14, 2014, 01:19:02 am
 you can check this on :

Admin fees (columns)

http://jsfiddle.net/rgorantla/Ljd57c1k/1/
Title: Re: Saving
Post by: paramvir on October 14, 2014, 02:23:01 pm
There are no drop downs in Admin fees columns. Could you please rephrase your question.
Title: Re: Saving
Post by: rgorantla on October 14, 2014, 09:38:09 pm
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
Title: Re: Saving
Post by: paramvir on October 15, 2014, 05:59:50 pm
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..
Title: Re: Saving
Post by: rgorantla on October 15, 2014, 07:08:34 pm
not really - just click save and drop downs are appearing for me.

When i made editable : true by default - these are resolved too ...