Redirect the right form directly to jqGrid without displaying the grid

Often I need to edit a single record in the database without having to display the grid at all. I can hide the grid using CSS or jQuery. What I could not understand was to go directly to the editing form from another web page, hiding the grid.

I know that this seems to defeat the goal of having a grid, but this is one of those cases when only one record should be viewed and modified by users similar to the Access single record mode. Is it possible?

enter image description here

+6
source share
2 answers

In general, you can simply hide the so-called "gbox" created over the grid, and then call editGridRow with the parameters you like to have. As a result, you will have a form close to what you want. I am sure you need to make some other small problems, but at first glance it might be what you want. In addition, you can scroll through the lines while editing.

Demo demonstrates what I mean. It displays the following form

enter image description here

Demo uses the following code

$("#list").jqGrid({ ... loadComplete: function (data) { $(this).jqGrid("editGridRow", data.rows[0].id, { modal: true, overlay: 0, // create no overlay onClose: function () { return false; // don't allow to close the form } }); } }).closest(".ui-jqgrid").hide(); 
+3
source

This is one of the reasons why I like my own custom editing forms rather than the ones built into jqGrid. Then you can simply open it, as in the jqGrid handler (with the corresponding parameters, of course), no mesh is required.

+1
source

Source: https://habr.com/ru/post/955204/


All Articles