Adding a jqGrid pager after Grid creation - jqgrid

Does anybody know how adding a jqGrid pager after grid creation using 'tableToGrid' function?

jqGrid uses internally the setPager function to make the most work for creating of the pager. The function setPager is local and can't be called from the outside.
If you need have in some situation the pager I would recommend you to create it always, but hide with respect of $('#pager').hide() till the pager will be needed. The grid with hidden pager looks exactly like the grid without pager.

Related

Kendo MVC: editable grid with local data

I want to create editable Kendo MVC grid bound to local data(some IEnumerable<>).
I found this and this. But first is only for js and second is not ediatable.
Is it possible?
I have tried all modes of Editable. But Editable() requires to specify related actions and it's impossible to prevent its execution.
As far as I know, editing is not supported with server side binding. In the past, I have used a Template column with links to edit the items. An example:
cols.Template(#<text>Edit</text>)

Redirect to jqGrid edit form directly without displaying the grid

Often I need to edit a single record in a database without the need to display the grid at all. I can hide the grid using CSS or jQuery. What I couldn't figure out is to directly go to the edit form from another webpage while hiding the grid.
I know it's kind of defeating the purpose of having a grid, but it's one of those cases where only a single record should be view and modified by the users similar to the Access single record mode. Is it even possible?
In general you can just hide so named "gbox" created over the grid and then call editGridRow method with the options which you like to have. As the result you will have the form which close to what you want. I am sure that you have to make some other small problems, but the first look can be like you want. Moreover you can scroll over the rows during editing.
The demo demonstrate what I mean. It displays the following form
The 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();
This is one of the reasons I like to use my own custom edit forms, instead of the one built into jqGrid. Then you can just open it like you would from the jqGrid handler (with appropriate parameters of course), no grid required.

How to appened Data in JQGrid table Cell?

I have created JQGrid.
I have put the Data in cell and one html Link in cells.
OnClick of that link I need to open JQGrid Specific popUp.Popup have one combobox .I'll select one option and click submit button and that data needs to be appear in clicked cell.
Thanks
The construction which you suggest seems me too complex. Probably you can consider to use more simple user interface?
Nevertheless you can just use setCell method to set new contain of the cell of the grid.

Attach method to all jqgrid instances?

I want to remove the pointer cursor from all non-sortable column headers in all of my jqGrids as in this answer. I currently do so for some of them in the gridComplete event.
Is there a way to set a default event, or grab all of the jqGrids on a page, and append that function the gridComplete event? I could not find anything in the options.
If you don't change the value of sortable property of the columns dynamically you don't need to do this on every grid refreshing. The columns will be created once at the creating of jqGrid. So you can just place the code which fixes the cursor on non-sortable columns after the grid definition. So you don't need to use gridComplete or any other callback.
By the way I use the word "callback" instead of "event" used in jqGrid documentation because you can define really one callback per grid. So you can't easy define somewhere in common place gridComplete with common actions and use another gridComplete in the grid definition. So if you define gridComplete as default option $.jgrid.defaults (see here) it will default till you not overwrite it in the definition of some jqGrid. To fix the problem I posted detailed suggestion how to extend functionality of jqGrid to support real events. Later I posted pull request with the changes. After long discussion the functionality is included in the code of jqGrid. So the next version jqGrid (which should be published in a short time) will do have support events additionally to callbacks.

jqGrid NavBar custom HTML

I need help with jQuery jqGrid and subgrid.
I am able to create a Subgrid inside my jqGrid succesfully. The next step is to add a custom option list in the main grid navbar somewhere so that depending on which option the user selects, a different kind of subgrid opens.
Is it possible to add custom options to the jqGrid navigation bar?
The only standard way to add custom element in the navBar is to use navButtonAdd method which add a button.
If you want to add another custom HTML elements you have to do this manually with respect of some jQuery function like jQuery.append. I recommend you to read the code of navSeparatorAdd and navButtonAdd functions.

Resources