ParamQuery grid support forum

General Category => Help for ParamQuery Grid (free version) => Topic started by: dmcheng on October 16, 2013, 03:34:39 am

Title: Make columns required entry?
Post by: dmcheng on October 16, 2013, 03:34:39 am
Hello.  Can I make a column to be required entry?

Thanks
David
Title: Re: Make columns required entry?
Post by: paramvir on October 16, 2013, 10:16:08 am
yes

For live checking the cells while in edit mode.

listen to cellEditKeyDown event
if evt.keyCode == "tab key" && column.require==true && $cell.value()==""
{
  evt.preventDefault();
  return false;
}



and for checking the whole data in grid.


loop through dataModel.data
and then loop through colModel

find the cells where rowData[dataIndx]=="" && column.required==true
{
  editCell http://paramquery.com/api#method-editCell (http://paramquery.com/api#method-editCell)
  break out of loop
}