Author Topic: Saving  (Read 5987 times)

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Saving
« 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 !

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Saving
« Reply #1 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.

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Saving
« Reply #2 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'


paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Saving
« Reply #3 on: October 10, 2014, 12:10:14 am »
you haven't passed rowIndx to isEditableCell?

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Saving
« Reply #4 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

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Saving
« Reply #5 on: October 10, 2014, 07:24:35 am »
rowIndx can be obtained from rowData by getRowIndx method.

http://paramquery.com/pro/api#method-getRowIndx

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Saving
« Reply #6 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?

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Saving
« Reply #7 on: October 14, 2014, 01:19:02 am »
 you can check this on :

Admin fees (columns)

http://jsfiddle.net/rgorantla/Ljd57c1k/1/
« Last Edit: October 14, 2014, 01:25:05 am by roseline.gorantla »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Saving
« Reply #8 on: October 14, 2014, 02:23:01 pm »
There are no drop downs in Admin fees columns. Could you please rephrase your question.

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Saving
« Reply #9 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

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Saving
« Reply #10 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..

rgorantla

  • Pro Deluxe
  • Jr. Member
  • *
  • Posts: 88
    • View Profile
Re: Saving
« Reply #11 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 ...