1

I am use inline nav in jqgrid. so i want to add new row. when i add new row with this row data i want to pass some other external data. How it is possible?

Michael Irigoyen
  • 22,513
  • 17
  • 89
  • 131
Ashish Mehta
  • 7,226
  • 4
  • 25
  • 52
  • You should specify more clear which "external data" you need to use? – Oleg Nov 05 '12 at 07:00
  • grid = $('#list') is my Grid. and i want to add new row using inline nav so i use inline nav in jqgrid. when i add new row with this edirUrl i want pass Login person Id. – Ashish Mehta Nov 05 '12 at 07:03
  • You wrote that you want **to pass some other external data** what you add new row with respect of `inlineNav`. My question was **which kind of external data you mean**? – Oleg Nov 05 '12 at 07:07

1 Answers1

1

You need use addParams property of the option of inlineNav. See examples here, here and here for example.

UPDATED: Below is an example of the code:

$("#list").jqGrid("inlineNav", "#pager", {
    addParams: {
        addRowParams: {
            keys: true,
            extraparam: {
                Patient_Id: function () {
                    return $("#sId").val();
                }
            }
        }
    }
});
Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • I am use first link u given.in this code when i save data i want to pass data like var Patient_Id=$(#sId).val(); so how to pass PatientId with my editurl:addMedicine.html – Ashish Mehta Nov 05 '12 at 07:25
  • @AshuMehta: You can use for example `extraparam` parameter inside of `addParams` which defines `Patient_Id` property as function returned `$(#sId).val()`. See [the second link](http://stackoverflow.com/a/10396691/315935) from my answer for the code example. – Oleg Nov 05 '12 at 07:36
  • like this extraparam: { retuen PatientId; } – Ashish Mehta Nov 05 '12 at 09:09
  • @AshuMehta: NO! Like `extraparam: { Patient_Id: function () { return PatientId; }} `. Just see the code from [the second link](http://stackoverflow.com/a/10396691/315935) and search for `extraparam` on the page. – Oleg Nov 05 '12 at 09:20
  • In Inline nav as my previous Problem Plus '+' Can not be display – Ashish Mehta Nov 05 '12 at 09:24
  • My code is J(#list).j('inlineNav',pager,{ addParams:{ positions:"afterSelected", addRowParams:{}, extraparam:{ Patient_Id:funcation(){return PatientId;} } } }) – Ashish Mehta Nov 05 '12 at 09:25
  • @AshuMehta: `extraparam` have to be the property of `addRowParams`. So `addRowParams:{}, extraparam: {...}` is wrong. Please, read [the code](http://stackoverflow.com/a/10396691/315935) carefully. I updated my answer with the code example. – Oleg Nov 05 '12 at 09:36
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/19148/discussion-between-ashumehta-and-oleg) – Ashish Mehta Nov 06 '12 at 10:38
  • extraparam is not work in addParams but its work only in EditParams – Ashish Mehta Nov 06 '12 at 13:58
  • @AshuMehta: If you think that you found a bug in `inlineNav` you should demonstrate if on an test case. After that one will be able either reproduce the problem, find the bug in jqGrid and fix it or one will be able to find bug in your demo. – Oleg Nov 06 '12 at 14:07
  • I am not sure but in addParams code somewhere mastic by me Thanks for help. – Ashish Mehta Nov 07 '12 at 04:55