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
jQuery complete-event after row-edit
06/10/2009
04:43
Avatar
JimmyOS
Member
Members
Forum Posts: 14
Member Since:
10/09/2009
sp_UserOfflineSmall Offline

Hi Tony,

first I'm impressed about the time you need to fix bugs. Today I noticed an behaviour with the jQuery ajax complete event. If I edit a row and the data had been send to server, the global jQuery ajax complete event hadn't been triggered.

Here is an example:

I configure an global complete event for jQuery ajax:

$.ajaxSetup ({
    url: 'index.php',
    type: “POST”,
    beforeSend: myBeforeSendFn,
    complete: myCompleteFn,
    error: myErrorFn
});

Than I configure the grid (I shortened the setup for example purposes):

var lastSel = null;
$GridTbl = $('#gridTbl');
$GridTbl.jqGrid({
    url: 'index.php',
    editurl: 'index.php?pageId=1019',
    colNames: ['Id', 'Description', 'Sum'],
    colModel: [{name:'rowid', hidden: true},
               {name:'description', editable: true},
               {name:'costsum', editable: true, width: 80, align: 'right', formatter: 'currency'}],
    onSelectRow: function (id) {
        if(id && id!==lastSel){
            $GridTbl.restoreRow(lastSel);
            lastSel=id;
        }
       
        $GridTbl.editRow(id,
                         true,
                         null,
                         function (e) {
                            // ******** BUG-BEHAVIOUR ********
                            // Because of the bug I have to trigger
                            // the global ajax complete event manually
                            myCompleteFn ();
                            // Other code …
                         },
                         null,
                         {'saveRow': true},
                         null, null,
                         function (rowid) {
                            alert (”There was an error with row ” + rowid);
                         }
                         );
    }
});

After that I edit a row and hit enter to save the data. The server request had been completed but the “myCompleteFn” function hadn't been triggered. Maybe I misunderstand the functionality?

06/10/2009
08:01
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

I do not think that this is a bug. Think a little.

You have a global setup for ajax- complete, but this complete event is then overwriten by the particular one in saveRow method.

Please read this

http://docs.jquery.com/Ajax/jQ.....up#options

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

06/10/2009
08:55
Avatar
JimmyOS
Member
Members
Forum Posts: 14
Member Since:
10/09/2009
sp_UserOfflineSmall Offline

All right. Thanks a lot!

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
60 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