Author Topic: Cancel cell edition  (Read 5743 times)

pafcosta

  • Newbie
  • *
  • Posts: 3
    • View Profile
Cancel cell edition
« on: August 08, 2013, 12:45:00 am »
hi,

First my congratulations for your work. This plugin is very good.

I have one question related with cell edition. Some rows shouldn't be edited, if  a particulary a cell have a specific value.

This is possible?

Thanks,
/Paulo

pafcosta

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Cancel cell edition
« Reply #1 on: August 16, 2013, 01:20:06 pm »
Hi all,

I already get a solution.
 var currencyEditor = function (ui) {
             
             debugger
            var $cell = ui.$cell, data = ui.data, rowIndx = ui.rowIndxPage, colIndx = ui.colIndx;
           //this is the collumn that store if the row is editable or not
           if (data[rowIndx][1] == 0)
            {
                var dc = $.trim(data[rowIndx][colIndx]);
                $cell.css('padding', '0');

                var $inp = $("<input type='text' style='padding:2px;border:0;vertical-align:bottom;text-align: right;width:79px;'/>")
                .appendTo($cell).autoNumeric( {aSep: ',',  mDec: '2'}).val(dc); //.focus();
            }
            else
            {
                $("#grid").pqGrid("quitEditMode");
                alert('No editable!!');           
            }
           
        }


I hope this helps the community!

BR,
/Paulo

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Cancel cell edition
« Reply #2 on: August 16, 2013, 03:38:14 pm »
Thanks for sharing.

Pro has easy to use callback function editable to enable editing of rows selectively depending upon any runtime condition.

http://paramquery.com/pro/api/#option-editable

« Last Edit: September 12, 2013, 12:51:41 pm by paramquery »