Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
jqGrid with localArray - Inline Navigation : get delete row button and call custom function
06/04/2013
08:45
Avatar
mohitagr.pec
Member
Members
Forum Posts: 3
Member Since:
27/03/2013
sp_UserOfflineSmall Offline

I am using jqGrid with localArray data. I am fetching this array from azure db and binging to grid. After this on manipulation of every single row, I am planning to update it in DB.

I am using inline navigation bar. On clicking of "add row", "save row" & "delete row" button I want to call my custom function and then would like to save/delete data in DB from that function.

First I would like to know whether my design is correct and scalable or not.

At present, I am able to call custom function on click of save button using "aftersavefunc" parameter.

Second, please let me know which parameter I have to set for "delete row" button. I think for "add row", same parameter can work as we have to click "save row" button to save row.

My code is as below for reference :

jQuery("#list4").jqGrid({
        datatype: "local",
        data: myData,
        height: "auto",
        colNames: ['RowNo', 'RouteId', 'Area', 'BusStop', 'Seater', 'Lat', 'Long', 'Timing', 'FromTo', 'KeyPoint'],
        colModel: [
                  { name: 'id', index: 'id', width: 50, sortable: false },
                  { name: 'RouteId', index: 'RouteId', width: 50, sortable: false },
                  { name: 'Area', index: 'Area', width: 130, sortable: false, editable: true, editrules: { required: true} },

              ],
        multiselect: false,
        rownumbers: false,
        rowList: [10, 20, 30],
        pager: jQuery('#pager1'),
        viewrecords: true,
        caption: "Bus Schedule Data",
        editurl: "clientArray",
        restoreAfterSelect: false,
        loadonce: true

    });
    var rowid;
    var inlineparams = {
        addParams: { useFormatter: false },
        editParams: {
            aftersavefunc: function (id) {
                var rowData = jQuery('#list4').jqGrid('getRowData', id);
                ScheduleTable.update({ id: 1, Area: rowData.Area.toString() });
            }
        },
        add: true,
        edit: true,
        save: true,
        cancel: true,
        del: true
    };

    jQuery("#list4").jqGrid('navGrid', "#pager1", { edit: false, save: false, add: false, cancel: false, del: false });
    jQuery("#list4").jqGrid('inlineNav', "#pager1", inlineparams);
    jQuery('#list4').jqGrid("saveRow", id, {
        keys: false,
        url: "clientArray"
    });

06/04/2013
17:04
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

You can fin my answer on your question here.

Best regards
Oleg

06/04/2013
17:51
Avatar
mohitagr.pec
Member
Members
Forum Posts: 3
Member Since:
27/03/2013
sp_UserOfflineSmall Offline

OlegK said:

You can fin my answer on your question here.

Best regards
Oleg


Thanks a lot oleg for putting up such a nice analysis. I would really like to move to Ajax based version instead of local array version. But there is a complexity in my scenario. I have a mobile service hosted on azure and my web site is hosted under azure web services. I am using my mobile service data from my azure web service. Now If I go through Ajax based version, I have to open a service end point on azure web service and that will make a call to data table hosted under azure mobile services. So it will be again an indirect call to database. Would it be able to provide benefits which you are mentioning? Just brainstorming....let me know if you have some suggestion on this.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
76 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

OlegK: 1255

markw65: 179

kobruleht: 144

phicarre: 132

YamilBracho: 124

Renso: 118

Member Stats:

Guest Posters: 447

Members: 11373

Moderators: 2

Admins: 1

Forum Stats:

Groups: 1

Forums: 8

Topics: 10592

Posts: 31289

Newest Members:

, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information