Author Topic: Make columns required entry?  (Read 3651 times)

dmcheng

  • Newbie
  • *
  • Posts: 1
    • View Profile
Make columns required entry?
« on: October 16, 2013, 03:34:39 am »
Hello.  Can I make a column to be required entry?

Thanks
David

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Make columns required entry?
« Reply #1 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
  break out of loop
}




« Last Edit: October 16, 2013, 06:36:46 pm by paramquery »