ParamQuery grid support forum
General Category => Help for ParamQuery Grid (free version) => Topic started by: kavyasetty on December 13, 2013, 11:33:01 am
-
Hi ,
is it possible to make a particular cell not editable?
-
return false in cellClick event.
This might be helpful http://jsfiddle.net/LAgZx/71/
-
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.
-
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
-
Thank you! I thought it was just for columns, missed the row part.