ParamQuery grid support forum

General Category => Help for ParamQuery Grid (free version) => Topic started by: kavyasetty on December 13, 2013, 11:33:01 am

Title: is it possible to make a particular cell not editable?
Post by: kavyasetty on December 13, 2013, 11:33:01 am
Hi ,

is it possible to make a particular cell not editable?
Title: Re: is it possible to make a particular cell not editable?
Post by: paramvir on December 13, 2013, 09:23:00 pm
return false in cellClick event.

This might be helpful http://jsfiddle.net/LAgZx/71/
Title: Re: is it possible to make a particular cell not editable?
Post by: Leo F on February 04, 2014, 11:31:01 am
Here is the code I added to prevent certain rows from being editable:

        obj.cellClick = function (event, ui) {
            var $td = $(this).find('.pq-cont tr[pq-row-indx=' + ui.rowIndx + '] td[pq-col-indx=' + ui.colIndx + ']');
            if (!$td.is('.gridRowEditable td')) {
                event.preventDefault();
                return false;
            }

        }

        obj.cellSelect = function (event, ui) {
            var $td = $(this).find('.pq-cont tr[pq-row-indx=' + ui.rowIndx + '] td[pq-col-indx=' + ui.colIndx + ']');
            if (!$td.is('.gridRowEditable td')) {
                event.preventDefault();
                return false;
            }
        }

Unfortunately this does not prevent the user from tabbing or using the keyboard to navigate to those cells. Any other suggestions?

Thank you.
Title: Re: is it possible to make a particular cell not editable?
Post by: paramvir on February 04, 2014, 11:54:49 am
You don't need to use low level API; there is specific API in PRO for the same task.

use this option for rows.
http://paramquery.com/pro/api#option-editable

and use this option for cells.
http://paramquery.com/pro/api#option-column-editable

Title: Re: is it possible to make a particular cell not editable?
Post by: Leo F on February 04, 2014, 08:43:41 pm
Thank you! I thought it was just for columns, missed the row part.