Author Topic: Commit data to grid on (click) blur  (Read 3721 times)

blaatpraat

  • Newbie
  • *
  • Posts: 2
    • View Profile
Commit data to grid on (click) blur
« on: June 24, 2014, 02:04:49 pm »
Greetings

I've implemented pqGrid into my application.
It works fine, and does everything like I want, except for one thing.
When I modify data, and press the tab button, the data is committed to the grid.
Otherwise: the data is truncated.

Now the way I want to work with it, is the following:
Click on a cell, edit the content, click on another cell (or even totally outside the grid) and so on.
But in this case the data is truncated, and the original data reappears.

I can write a javascript listener on the editable div that transfers the content to the td content when someone blurs it, but maybe there is a native way to do this?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: Commit data to grid on (click) blur
« Reply #1 on: June 24, 2014, 02:11:34 pm »
PRO version has a native way to handle this case.

In basic version, you have to write a blur listener and call saveEditCell instead of transferring the content to td.

saveEditCell would automatically take care of everything. I hope it makes it easier for you.

blaatpraat

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Commit data to grid on (click) blur
« Reply #2 on: June 24, 2014, 02:42:02 pm »
I didn't saw it between the features of the PRO version, sorry about that.
I've tried the demos of the PRO, and I must say: looking good, it's worth paying for that.
I won't do it for now, but I will in the future. :-)

I've discovered that I cannot set a blur listener on an editable div, but jqGrid has an event that does this for you (quit edit mode).
When triggered, I do saveEditCell, and everything is working.

Thanks :-)