0

I'm using jqgrid inline edit in my application which is also accessed in mobile. Since the user access space in the mobile is small i dont want the pop-up's throwing in the middle.

So, basically when the user did not select the row and click the edit/delete button the warning dialog is thrown "Please, select a row". Now i did not want the alert. Just when the user click on the edit/delete button without selecting the row it should stand still. Nothing happens.

Is this possible? How can i achieve this?

A Coder
  • 3,039
  • 7
  • 58
  • 129

1 Answers1

1

I would suggest you another way. One can disable or hide Delete/Edit buttons until a row will be selected. Inside of loadComplete one should test whether any row is selected (it could be selected if you use reloadGrid with {current:true} option for example). In the case you can disable or hide Delete/Edit buttons once more.

The demo created for the old answer shows how to disable navigator buttons by adding ui-state-disabled class. Another demo created for the answer demonstrates in interactive form how to show/hide navigator buttons.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • It didn't work when disabling the icons in "loadComplete", loadComplete: function () { $("#CommentsData_iledit").addClass('ui-state-disabled'); $("#del_CommentsData").addClass('ui-state-disabled'); }}, any idea? – A Coder Dec 03 '14 at 10:22
  • @SanthoshKumar: Which *datatype* you use? For example if you use `datatype: "local"` together with `data` parameter then `loadComplete` will be called at the first time *before* `navGrid` and `inlineNav` creates the corresponding buttons. So you have to disable the buttons not only inside of `loadComplete` but after `navGrid` and `inlineNav` too. You should append the text of your question with the current code which not yet work if my last tip will don't help you. – Oleg Dec 03 '14 at 10:49
  • You are right. Added after the creation of the pager. Can you look into this? http://stackoverflow.com/questions/27268215/disable-next-last-pager-in-jqgrid – A Coder Dec 03 '14 at 10:57