2

I'm trying to do an inline edit with a column with formatter: 'actions' and want to send the information to the server in JSON format, but I cant. I already tried many things, but with no results. Still sending information without serializing.

Also tried $.extend($.jgrid.edit, (...)); at the initialization $(function(){...}); with no result.

My formatoptions looks like this:

formatoptions: {
    keys: true,
    editbutton: true,
    delbutton: true,
    //url: url,
    editOptions: {
        url: url,
        ajaxEditOptions: {
            //url: url,
            contentType: 'application/json;charset=utf-8',
            type: 'POST',
            datatype: 'json'
        }
    },
    delOptions: {
        url: url,
        ajaxDelOptions: {
            //url: url,
            contentType: 'application/json;charset=utf-8',
            type: 'POST',
            datatype: 'json'
        }
    }
}}

But still not working :S I dont know what im doing wrong. I'd appreciate if you help me.

PS: I writted too many url properties, becuase I was checking where I have to write it to do it work. For edit, only works if I put the url out of editOptions, only if I put it in formatoptions. But for delete, it don't cares if I put it in/out delOptions, including ajaxDelOptions. If you could help me with that too, I'd appreciate.


UPDATED

Delete works fine with this config, but inline editing save button still not working. I pasted the same config, changing options for editing and still not working.

delOptions: {
    url: url,
    mtype: 'POST',
    reloadAfterSubmit: true,
    ajaxDelOptions: {
        contentType: "application/json"
    },
    serializeDelData: function(postdata) {
        return JSON.stringify(postdata);
    }
}




UPDATED 2

Here is my JS.

$(function() {
    $.mask.definitions['2'] = '[0-2]';
    $.mask.definitions['5'] = '[0-5]';
    $.extend($.jgrid.defaults, {
        ajaxRowOptions: {
            contentType: "application/json",
            dataType: "json",
            success: function() {

            },
            error: null
        },
        serializeRowData: function(data) {
            delete data.oper;
            return JSON.stringify(data);
        }
    });
});
function loadGrid(identifier) {
    $("#list").jqGrid({
        url: 'foo.html?identifier=' + identifier,
        type: 'GET',
        datatype: 'json',
        repeatitems: false,
        autowidth: true,
        altRows: false,
        hidegrid: false,
        cmTemplate: {
            sortable: false,
            resizable: false
        },
        colNames: ["id", "column1", "column2", "column3", "column4", "column5", "column6", "column7", " "],
        colModel: [
            {name: "id", label: "id", hidden: true},
            {name: "columnData1", label: "columnData1", key: true, hidden: true},
            {name: "columnData2", label: "columnData2", edittype: "select", editable: true,
                editoptions: {
                    dataUrl: 'foo/bar.html'
                }},
            {name: "columnData3", label: "columnData3", width: 75, editable: true},
            {name: "columnData4", label: "columnData4", width: 100, edittype: "select", editable: true,
                editoptions: {
                    dataUrl: 'foo/bar.html'
                }},
            {name: "columnData5", align: "right", label: "columnData5", width: 55, formatter: 'number',
                formatOptions: {
                    decimalPlaces: 2
                }, editable: true},
            {name: "columnData6", align: "right", label: "columnData6", width: 55, formatter: 'number',
                formatOptions: {
                    decimalPlaces: 2
                }, editable: true},
            {name: "columnData7", align: "right", label: "columnData7", width: 55, formatter: 'number',
                formatOptions: {
                    decimalPlaces: 2
                }},
            {name: "actions", formatter: "actions", width: 35}
        ],
        pager: '#pager',
        rows: '',
        rowList: [],
        pgbuttons: false,
        pgtext: null,
        viewrecords: false,
        gridview: true,
        caption: 'MyCaption',
        subGrid: true,
        subGridRowExpanded: function(subgrid_id, row_id) {
            var subgrid_table_id, pager_id;
            subgrid_table_id = subgrid_id + "_t";
            pager_id = "p_" + subgrid_table_id;
            $("#" + subgrid_id).html("<table id='" + subgrid_table_id + "'></table><div id='" + pager_id + "'></div>");
            $("#" + subgrid_table_id).jqGrid({
                url: 'foo/bar.html?identifier=' + identifier + '&rowId=' + row_id,
                type: 'GET',
                datatype: 'json',
                repeatitems: false,
                autowidth: true,
                altRows: false,
                hidegrid: false,
                cmTemplate: {
                    sortable: false,
                    resizable: false
                },
                colNames: ['column1', 'column2', 'column3', 'column4', 'column5', 'column6', ' '],
                colModel: [
                    {name: 'columnData1', hidden: true, key: true},
                    {name: 'columnData2', width: 75, formatter: 'date',
                        formatoptions: {
                            srcformat: 'Y-m-d',
                            newformat: 'd/m/Y'
                        },
                        editoptions: {
                            readonly: 'readonly',
                            dataInit: function(elem) {
                                $(elem).width("75%");
                                $(elem).datepicker({
                                    dateFormat: "dd/mm/yy",
                                    showOn: "button",
                                    buttonImage: "../css/images/calendar.gif",
                                    buttonText: "Muestra el calendario.",
                                    buttonImageOnly: true
                                });
                            }}
                        , editable: true},
                    {name: 'columnData3', width: 75,
                        formatter: function(cellval, opts) {
                            if (!/^([0-1][0-9]|2[0-3]:[0-5][0-9])/.test(cellval)) {
                                var date = new Date(cellval);
                                opts = $.extend({}, $.jgrid.formatter.date, opts);
                                return $.fmatter.util.DateFormat("", date, 'H:i', opts);
                            } else {
                                var date = new Date();
                                var time = cellval.split(":");
                                date.setFullYear(1899);
                                date.setMonth(12);
                                date.setDate(30);
                                date.setHours(time[0]);
                                date.setMinutes(time[1]);
                                date.setSeconds(0);
                                opts = $.extend({}, $.jgrid.formatter.date, opts);
                                return $.fmatter.util.DateFormat("", date, 'H:i', opts);
                            }
                        },
                        editoptions: {dataInit: function(elem) {
                                $(elem).mask("29:59");
                            }},
                        editrules: {custom: true, custom_func: function(value) {
                                if (/^([0-1][0-9]|2[0-3]:[0-5][0-9])/.test(value)) {
                                    return [true, ""];
                                } else {
                                    return [false, " no es un formato de hora v&aacute;lido.<br/>Por favor, introduzca una hora en un formato <b>hh:mm</b> v&aacute;lido."];
                                }
                            }}, editable: true},
                    {name: 'columnData4', width: 80, editable: true},
                    {name: 'columnData5', width: 200, editable: true},
                    {name: 'columnData6', align: 'right', width: 50, editable: true, formatter: 'number',
                        formatoptions: {
                            decimalPlaces: 2
                        }},
                    {name: 'actions', formatter: 'actions', width: 40,
                        formatoptions: {
                            //keys: false,
                            editbutton: true,
                            delbutton: true,
                            url: "foo/bar/edit.html?identifier=" + identifier + "&rowId=" + row_id,
                            editOptions: {
                                keys: true,
                                //url: "foo/bar/edit.html?identifier=" + identifier + "&rowId=" + row_id,
                                mtype: "POST"
                            },
                            delOptions: {
                                url: "foo/bar/delete.html?identifier=" + identifier + "&rowId=" + row_id,
                                mtype: 'POST',
                                reloadAfterSubmit: true,
                                ajaxDelOptions: {
                                    contentType: "application/json"
                                },
                                serializeDelData: function(postdata) {
                                    delete postdata.oper;
                                    return JSON.stringify(postdata);
                                }
                            }
                        }}
                ],
                height: 190,
                pager: pager_id,
                rows: '',
                rowList: [],
                pgbuttons: false,
                pgtext: null,
                viewrecords: false,
                gridview: true,
                loadError: function(xhr, status, error) {
                    alert(xhr + " : " + status + " : " + error);
                },
                jsonReader: {
                    repeatitems: false
                },
                gridComplete: function() {
                    $("div.ui-inline-save").click(function() {
                        var dlgDiv = $("#info_dialog");
                        dlgDiv.width(600);
                        var parentDiv = dlgDiv.parent();
                        var dlgWidth = dlgDiv.width();
                        var parentWidth = parentDiv.width();
                        var dlgHeight = dlgDiv.height();
                        var parentHeight = parentDiv.height();
                        dlgDiv.css('top', Math.round((parentHeight - dlgHeight) / 2));
                        dlgDiv.css('left', Math.round((parentWidth - dlgWidth) / 2));
                    });
                    $("div.ui-inline-del").click(function() {
                        var dlgDiv = $("#delmod" + subgrid_table_id);
                        dlgDiv.width(600);
                        var parentDiv = dlgDiv.parent();
                        var dlgWidth = dlgDiv.width();
                        var parentWidth = parentDiv.width();
                        var dlgHeight = dlgDiv.height();
                        var parentHeight = parentDiv.height();
                        dlgDiv.css('top', Math.round((parentHeight - dlgHeight) / 2));
                        dlgDiv.css('left', Math.round((parentWidth - dlgWidth) / 2));
                    });
                    $("#gbox_" + subgrid_id + "_t").removeClass('ui-corner-all');
                    $("#" + pager_id).removeClass('ui-corner-bottom');
                    disableSelection(document.getElementById(subgrid_table_id));
                }
            }).navGrid("#" + pager_id, {add: true, edit: false, del: false, search: false, view: false, refresh: true}, {},
                    {afterShowForm: function(form) {
                            var dlgDiv = $("#editmod" + subgrid_table_id);
                            dlgDiv.width(600);
                            var parentDiv = dlgDiv.parent();
                            var dlgWidth = dlgDiv.width();
                            var parentWidth = parentDiv.width();
                            var dlgHeight = dlgDiv.height();
                            var parentHeight = parentDiv.height();
                            dlgDiv.css('top', Math.round((parentHeight - dlgHeight) / 2));
                            dlgDiv.css('left', Math.round((parentWidth - dlgWidth) / 2));
                        }
                    });
        },
        loadError: function(xhr, status, error) {
            alert(xhr + " : " + status + " : " + error);
        },
        jsonReader: {
            repeatitems: false
        },
        gridComplete: function() {
            $("div.ui-inline-save").click(function() {
                var dlgDiv = $("#info_dialog");
                dlgDiv.width(600);
                var parentDiv = dlgDiv.parent();
                var dlgWidth = dlgDiv.width();
                var parentWidth = parentDiv.width();
                var dlgHeight = dlgDiv.height();
                var parentHeight = parentDiv.height();
                dlgDiv.css('top', Math.round((parentHeight - dlgHeight) / 2));
                dlgDiv.css('left', Math.round((parentWidth - dlgWidth) / 2));
            });
            $("div.ui-inline-del").click(function() {
                var dlgDiv = $("#delmodlist");
                dlgDiv.width(600);
                var parentDiv = dlgDiv.parent();
                var dlgWidth = dlgDiv.width();
                var parentWidth = parentDiv.width();
                var dlgHeight = dlgDiv.height();
                var parentHeight = parentDiv.height();
                dlgDiv.css('top', Math.round((parentHeight - dlgHeight) / 2));
                dlgDiv.css('left', Math.round((parentWidth - dlgWidth) / 2));
            });
            disableSelection(document.getElementById("list"));
        }
    }).navGrid("#pager", {add: true, edit: false, del: false, search: false, view: false, refresh: true}, {},
            {afterShowForm: function(form) {
                    var dlgDiv = $("#editmodlist");
                    dlgDiv.width(600);
                    var parentDiv = dlgDiv.parent();
                    var dlgWidth = dlgDiv.width();
                    var parentWidth = parentDiv.width();
                    var dlgHeight = dlgDiv.height();
                    var parentHeight = parentDiv.height();
                    dlgDiv.css('top', Math.round((parentHeight - dlgHeight) / 2));
                    dlgDiv.css('left', Math.round((parentWidth - dlgWidth) / 2));
                }
            });
    var height = $("body").height();
    $('.ui-jqgrid-bdiv').height(height);
}

Changed column names, etc. for security (obviusly). This is my JS. I had to use jqGrid in a function and getting identifier as parameter, because I have a JSP that is loaded into a Iframe and that JSP has another Iframe that loads this JS. I needed to send the identifier that I recieve in the JSP to build the grid. The best way I found is that. Thats the identifier value.

Also, I need that identifier and the row_id to update data, because I have as 3 primary keys to identify an specific item. I need identifier, parent row_id and actual row_id that I'm editing. Last one I get it from the JS Object in JSON format.

It's like it does not recognize editOptions property, because it does not get keys: true. It didn't let me accept the edit with Enter key.

If you still needing more information, just ask.

DaGLiMiOuX
  • 889
  • 9
  • 28

1 Answers1

5

I think that the origin of your problem is misunderstanding about how formatter: 'actions' works.

There are tree main editing mode supported by jqGrid: inline editing, form editing and cell editing. If you don't use editformbutton: true option of formatter: 'actions' inside of formatoptions then Edit button will use inline editing. Delete button uses always form editing because there are no delete method in the inline editing module.

So if you includes some option inside of editOptions of formatoptions of formatter: 'actions' then it should be an option of editRow (see properties of editparameters object in the documentation). So you can specify for example

editOptions: {
    url: url,
    mtype: "POST", // is already default and can be removed
    keys: true
}

but the ajaxEditOptions will be ignored here. $.jgrid.edit can be used to change default values for editGridRow which is part of forme editing, but to change defaults of editRow you need use $.jgrid.inlineEdit instead.

delOptions allows you specify parameters of delGridRow. The UPDATED part of your question uses correct options. So Delete operation works correctly.

By the way you can use editurl option of jqGrid to specify URL used for both inline editing and form editing. So editurl: url on one place will be better as specifying url: url multiple times.

What you need to do for successful editing is adding ajaxRowOptions and serializeRowData as jqGrid options

ajaxRowOptions: { contentType: "application/json", dataType: "json" },
serializeRowData: function (data) { return JSON.stringify(data); }

or to set it in $.jgrid.defaults.

UPDATED: You misunderstand the value of unique id. HTML standard don't allows to have two elements with the same id attribute on the page. The demo which you posed don't use idPrefix in subgrids. If you opens subgrids for who rows and examine HTML code of the page with respect of Developer Tools (press F12 in IE) you will see the following

enter image description here

So you have to use idPrefix for subgrids. I recommend you to use the value which depends on rowid of the parent grid (something like idPrefix: "s_" + row_id + "_"). Look at here for more my answer about the subject.

UPDATED 2: I looked in the code of formatter: "actions" one more time and I see that it uses url option of formatter for inline editing operations (see the documentation) and uses delOptions for delete and editOptions for form editing. So editOptions.url will be used only if you would use editformbutton: true option.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • Thank you!! `ajaxRowOptions` works as spected. It sends information as JSON format. But still having the url problem. `url` property in `editOptions` does not work for me. It's a bug or just its not compatible with `editRow`? I saw that this property overrides `editUrl`... I dont have that property definied and stills not working `url` in `editOptions`. – DaGLiMiOuX Apr 17 '13 at 09:09
  • Forgot to say that when I press `save` button it shows a dialog with error text at header and error CSS design in content, but content is `OK`. That any other option that I forgot to disable? – DaGLiMiOuX Apr 17 '13 at 09:25
  • @DaGLiMiOuX: You are welcome! I think that the origin of your current problems could be *other JacaScript code* which you use and which you don't posted here. The problem with `url` could be because of *where*, *when* and *how* you defined `url` variable and when your assign/change it's value. – Oleg Apr 17 '13 at 09:29
  • No, I showed `url` as variable for security. It's not a variable, its plain text. Like this `url: "foo/bar/edit.html?rowIdParentGrid=" + identifier + "&rowIdSubGrid=" + row_id,`. `identifier` and `row_id` are variables that saves id's to use them for update in my server and saves the proper values (already checked). When I put the url in `editOptions` it uses the parent grid `url` property that gets all parent grid data `http://localhost:8084/project/foo/bar.html?id=1&_search=false&nd=1366191638407&rows=20&page=1&sidx=&sord=asc`. Thanks for your fast responses. – DaGLiMiOuX Apr 17 '13 at 09:38
  • @DaGLiMiOuX: So the variable `url` `identifier` need be *changed* at runtime because you want that it depends on `identifier` and `row_id`. I suppose that it's your problem. You can use `extraparam` defined with properties `rowIdParentGrid` and `rowIdSubGrid` as *functions* and modify `serializeRowData` to support the functions (see [here](http://stackoverflow.com/a/5811359/315935), [here](http://stackoverflow.com/a/7365228/315935) and other). You should post the JavaScript code which you use if you want that I point you the place where you use `url` in a wrong way. – Oleg Apr 17 '13 at 10:04
  • Updated question with my JS. – DaGLiMiOuX Apr 17 '13 at 10:29
  • @DaGLiMiOuX: I can't find where `loadGrid` function will be called. In general one can call the function **only once**. – Oleg Apr 17 '13 at 10:36
  • `loadGrid` function its called in the JSP as ``. Is the best way I found to transfer the identifier from an `object` recieved in a JSP to JS and load the grid via `url.html?parameter=id`... – DaGLiMiOuX Apr 17 '13 at 10:41
  • @DaGLiMiOuX: Is `identifier` some static constant which defined on the server? In any way you have to place call `loadGrid` inside of `$(function() {...})` (inside of `$(document).ready(function() {...})`). Why you not use just `url: 'foo.html?identifier=<%=identifier%>'`? It could be required to use `encodeURIComponent(identifier)` in URL. If you separate the most JavaScript code from HTML code that you can place `` on HTML page and just use `MY_GLOBAL_IDENTIFIER` in your JavaScript code. – Oleg Apr 17 '13 at 10:49
  • @DaGLiMiOuX: Do you tried to include `editurl: "foo/bar/edit.html?identifier=" + identifier + "&rowId=" + row_id` as additional parameter of subgrid instead of the usage `url` parameter multiple times? – Oleg Apr 17 '13 at 10:52
  • As I said, I have a JSP that has an `iframe`. That `iframe` loads a JSP and recieves a Java object, that has a parameter that is `id`. That JSP, needs another `iframe` inside to load another JSP. The url from that `iframe` is `foo.html?identifier=<%=identifier%>`. When loads that JSP, it gets that parameter via `Integer identifier = (Integer) request.getParameter('identifier');`. Now, when he recieved the `identifier`, I made a little script manually, this one ``. I dont know if it is or not clear already :S – DaGLiMiOuX Apr 17 '13 at 10:56
  • I didnt tried that, becuase I had 2 urls: `edit.html?...` and `delete.html?...` If I use `editurl` I have to take `oper` parameter from that Object when it arrives to server. I can do that and delete that parameter later? It's because of the `JsonTransformer` at server side. – DaGLiMiOuX Apr 17 '13 at 10:59
  • @DaGLiMiOuX: Sorry, but we are now far and far from your original question: how one can specify parameters of Edit and Delete if one uses `formatter: 'actions'`. Could you repeat what is your current problem? What is still not solved? The code which you posted uses `url` as property of `formatoptions` which is wrong. The correct `url` line inside of `editOptions` is commented. Could you fix the problem and try your code once more time? – Oleg Apr 17 '13 at 11:08
  • @DaGLiMiOuX: I would strictly recommend you to use `idPrefix` option to have no id duplicates. You can move the code of some common callbacks in `$.jgrid.defaults`. In the way you can remove duplicates from main grid and subgrids. You should clean up usage of jqGrid options too. I would recommend you to use column templates additionally. You have for example multiple columns with numbers you can define variable `numberTemplate` and use `template: numberTemplate` in `colModel` (see [here](http://stackoverflow.com/a/6047856/315935)). It will reduce the code and makes it more manageable. – Oleg Apr 17 '13 at 11:14
  • I commented `url` property from `formatoptions` and used the correct `url` line inside `editOptions`. What it does is using the parent `url` `'foo.html?identifier=' + identifier`. The iframe url. I dont know why it uses that `url` as default instead the `url` that I defined in `editOptions`. Also, I dont use numbers for column names. For security I removed all information. Sorry :P hehe – DaGLiMiOuX Apr 17 '13 at 11:15
  • Yep. First I will try to finish this and later I will reduce the code using templates as much as I can. Thanks for the recommendation and sorry for that awkward code :( – DaGLiMiOuX Apr 17 '13 at 11:26
  • @DaGLiMiOuX: You are welcome! The most *real code* is awkward, so no problem. I find the problem with usage of wrong `url` very strange. Probably there are a bug in jqGrid or there are a bug in your code. I would recommend you to debug the code. You can set breakpoint inside of [$.fn.fmatter.rowactions](https://github.com/tonytomov/jqGrid/blob/v4.4.5/js/jquery.fmatter.js#L390-L476). You should use `jquery.jqGrid.src.js` instead of `jquery.jqGrid.min.js` of cause. – Oleg Apr 17 '13 at 12:01
  • I'm trying to debug but... Its TOO vast... u.u Thank you anyway. What im gona try now its to get `oper` property that jqgrid adds to my JSON serialized object sended to my server and work with that option (if want to edit or delete). – DaGLiMiOuX Apr 17 '13 at 14:19
  • @DaGLiMiOuX: I suspect now that your problem is the problem with id duplicates. You have `{name: 'columnData1', hidden: true, key: true}` in **both grids and subgrid**. So you can have id dupplicates. Just try to add option `idPrefix` to subgrid or one `idPrefix` for main grid (for example `idPrefix: "m_"`) and another for subgrid ((for example `idPrefix: "s_"`)). I hope that it will fix your problem. – Oleg Apr 17 '13 at 14:31
  • Thanks for the suggestion, but it's not fixing the problem. I added both `idPrefix` properties, on each grid and I split it at server to get only the ID. The save button stills going to this url `http://localhost:8084/foo/foo2/foo3.html?identifier=1` when it has to go to `http://localhost:8084/foo/foo2/foo3/foo4/edit.html?identifier=1&row_id=m_1`. These are the correct id's, are not ommitted for security. – DaGLiMiOuX Apr 17 '13 at 15:03
  • @DaGLiMiOuX: I am not sure that I understand your current problem correctly, but if you use `idPrefix` and you need to construct `id` from `rowid` (`id` with prefix) you can use `$.jgrid.stripPref` method used by jqGrid internally. For example `$.jgrid.stripPref("m_", rowid)` returns `"1"` id `rowid="m_1"`. I don't understand which security problems you mean. – Oleg Apr 17 '13 at 15:08
  • With ommited security I mean that those `id` that I posted are the real ones. Nothing important. With `idPrefix` I recieve the info I posted. `identifier=1`, `row_id=m_1` (this is the row from the parent grid. If I press delete with the second row of the parent grid it sends `row_id=m2` through URL). Also, recieve the `key` property of that row that I pressed delete. Those 3 are the 3 keys I need to edit that specific row in my database. Sorry if it was not clear before, hehe – DaGLiMiOuX Apr 17 '13 at 15:16
  • Another thing that I can do is to put the operation at the url, get it as `httpServletRequest.getAttribute('oper')` and compare if is delete or edit at server side. Then use `editUrl` property for both at JS. I think that is not a bad solution hehe – DaGLiMiOuX Apr 17 '13 at 15:38
  • @DaGLiMiOuX: Sorry I still don't understand what is you current problem. Your code contains *two* `formatter: 'actions'`: one in the main grid and another in the subgrid. If the user click on "Edit" action button of the subgrid the correct `url` `"foo/bar/edit.html?identifier=" + identifier + "&rowId=" + $.jgrid.stripPref("m_", row_id)` should be called. If it's not so, then it could be a bug in jqGrid or a bug in your code. **One need debug the code** to find the reason. Could you provide URL (your live demo or made in http://jsfiddle.net/) to the demo which demonstrate the problem? – Oleg Apr 17 '13 at 15:49
  • I'm new on posting here, so I dont really know how to "POST" my code in a web page like that. Rework all JS to use and edit `LOCAL` data? (It will take a while) – DaGLiMiOuX Apr 17 '13 at 16:03
  • @DaGLiMiOuX: just search for words "jsfiddle tutorial". You will find for example [this video](http://www.youtube.com/watch?v=zrWkRHSK6A8) on the first page. You can use jsFiddle [/echo/json](http://doc.jsfiddle.net/use/echo.html) feature, but mostly it's enough to fill *local* grid, but use some relative URLs (exact youth) for editing. You will be not able to save modified data in the way, but one could see in [Fiddler](http://fiddler2.com/get-fiddler), Firebug or in other tool the URL to which the request will be send. So you can made the demo in the way. – Oleg Apr 17 '13 at 16:46
  • I already got my JS with `Local Data`. Sorry for taking so long, but had a bit code to edit. I have a problem to upload my code because I cant upload jqGrid. jsfiddle does not have a checkbox to load jqGrid, or atleast I didnt find it. Suggestions? – DaGLiMiOuX Apr 18 '13 at 08:33
  • @DaGLiMiOuX: The video which I referenced shows that you can click on `External Resources`, type some URL of CSS or JS (like `http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.4.5/css/ui.jqgrid.css`, `http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.4.5/js/i18n/grid.locale-en.js`, `http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.4.5/js/jquery.jqGrid.src.js`) and then click on "+" to add every external resource. – Oleg Apr 18 '13 at 08:42
  • thanks. I supposed to do that, but what I was asking is if there is any page where I can upload the resources that I'm using, but with jqGrid will be enough for the demo I think. Thanks for the links. **UPDATED** Still not loading :S and developers tools from google chrome reported no errors – DaGLiMiOuX Apr 18 '13 at 08:47
  • @DaGLiMiOuX: You are welcome! I wait for the URL for the demo which reproduce the described problem (for example for the demo on jsfiddle). If you use jsfiddle and use `datatype: local` you can place all what you need here. What additional resources you mean? What you need upload more for the demo? – Oleg Apr 18 '13 at 08:57
  • Was just for `input.mask` plugin, but it's nothing. JS can work without that. Anyway, now is giving an error about `$.jgrid.formatter.integer: Cannot read property 'integer' from undefined.` and gives that error at line 85 `$('#list').jqGrid({` http://jsfiddle.net/UsJ5x/ – DaGLiMiOuX Apr 18 '13 at 09:02
  • I found the error. Its because of `grid-locale`. When I go to the url you gave me, it sends me to a webpage to choose a `locale`. It happened to me with the exactly samecode in my computer, but used my `locale` and worked fine. I think its something wrong with the url u gave me :S **UPDATED** http://jsfiddle.net/UsJ5x/1/ I got the url for the correct `locale`. Probably a letter was missing in the url. Well you can check the perfect demo now. – DaGLiMiOuX Apr 18 '13 at 09:14
  • @DaGLiMiOuX: 1) Your demo uses wrong order of JS fils: one need include first `grid.locale-en.j‌​s` and then `jquery.jqGrid.src.js`. 2) You should change "onLoad" option to "onDomready" and remove `$(function() {...}` from the code. 3) **you current code uses `id:identifier` for every row** (see `dataMain`) which is a bug. you generate id duplicates in the way. 4) you don't use `idPrefix` for subgrid. so you will have more id duplicates. See [the answer](http://stackoverflow.com/a/16077909/315935) for example for details. – Oleg Apr 18 '13 at 09:27
  • 1) Ok, but it works, so I think that not solves my problem. 2) What's the difference and how I program that? I've never used `onDomready` 3) I use `id:identifier` as an **"EXTRA"** attribute. It's just another attribute. I dont have duplicated `row_id`, because if you take a look at `colModel` I putted `key:true` at `instanceNumber`. Identifier its just a value from the parent `iframe` of the `iframe` that is located the `jqGrid`. If I remove that attribute, stills working. 4) I dont use `idPrefix` on subgrid because I never send that info to any other web page. Anyway I can add it. – DaGLiMiOuX Apr 18 '13 at 09:42
  • @DaGLiMiOuX: See **UPDATED** part of my answer. – Oleg Apr 18 '13 at 09:58
  • @DaGLiMiOuX: I looked in the code of `formatter: "actions"` one more time and I see that it uses `url` option of *formatter* for inline editing operations (see [the documentation](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:predefined_formatter#predefined_format_types)) and uses `delOptions` for delete and `editOptions` for form editing. So `editOptions.url` will be used only if you would use `editformbutton: true` option. – Oleg Apr 18 '13 at 10:31
  • That's the problem. Where I can specify the url? We were discussing about why is not working on `editOptions`. I supposed that is bugged or it doesnt work with `inlineEdit`. Thats the only problem I have right now. I have to define it, because edit goes to `edit.html` and delete to `delete.html`. – DaGLiMiOuX Apr 18 '13 at 10:36
  • Thanks for notice me about my fault on row id's. Sorry for misunderstanding what you wanted to say with the `idPrefix` in `subGrid` – DaGLiMiOuX Apr 18 '13 at 10:52
  • @DaGLiMiOuX: You are welcome! Is the problem is solved now after usage of `idPrefix` and setting of `url` for inline editing on the correct place (see **UPDATED 2** in my answer)? In my tests I see no problem more. See http://jsfiddle.net/UsJ5x/8/ – Oleg Apr 18 '13 at 11:07
  • `URL` property at `formatoptions` and `URL` property at `delOptions` works properly! Delete goes to `delete.html` and if I edit any row, it sends information to `edit.html`. Great thanks for your pattience, all your recommendations and thanks for your help! ^_^ – DaGLiMiOuX Apr 19 '13 at 07:08
  • Sorry, I can't vote up your answer, because I dont have enough reputation... but... +1 for your answer!! ;) – DaGLiMiOuX Apr 19 '13 at 07:17
  • @DaGLiMiOuX: It's not a problem. After you will get 15 points of reputation you will be able to vote 30 answers or questions **per day**. So you will be able vote not only all old answers on your question, but all helpful information which you will find on the stackoverflow. It will help searching engine of stackoverflow and so it will help other users to find really helpful information. – Oleg Apr 19 '13 at 07:22