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
I now receive eData when alerting after executing delGridRow. Why?
29/04/2011
09:36
Avatar
dottedquad
Member
Members
Forum Posts: 12
Member Since:
24/01/2009
sp_UserOfflineSmall Offline

Hello all,

jqgrid snippet:

    gridComplete: function(){
    
        var ids = jQuery("#breed_list").jqGrid('getDataIDs');
        for(var i=0;i < ids.length;i++)
        {
            var cl = ids[i];
            ed = "<img src=\"../images/edit.png\" alt=\"Edit\" onclick=\"jQuery('#breed_list').editRow('"+cl+"');\" />";
            de = "<img class=\"del_row\" src=\"../images/delete.png\" alt=\"Delete\" />";
            ce = "<input class=\"del_row\" type='button' onclick=\"deleteRow()\" />";
            jQuery("#breed_list").jqGrid('setRowData',ids[i],{act:ed+de+ce});
        }
        
        $(this).mouseover(function() {
            var valId = $('.ui-state-hover').attr("id");
            jQuery("#breed_list").setSelection(valId, false);
            alert(valId);
            //deleteRow(valId)
        });

Custom function code:

function deleteRow(){

    // Get the currently selected row
    var toDelete = $("#breed_list").jqGrid('getGridParam','selrow');

    // You'll get a pop-up confirmation dialog, and if you say yes,
    // it will call "delete.php" on your server.
    $("#breed_list").jqGrid(
        'delGridRow',
        toDelete,
          {
               url: 'delete.php',
               reloadAfterSubmit:false
          }
    );
    //alert(toDelete);

}

That code auto selects the hovered cell correctly when delGridRow is NOT executed.  When I click the button under the actions column it calls the deleteRow() function which executes delGridRow. When I click cancel the delete form closes.  Now, when I hover a cell it does NOT auto select the current hovered cell.  To debug this I placed alert(valId) in the .mouseover function which returns eData instead of the id attribute value.  alert(valId) alerts out the id attribute value as long as the deleteRow function is not executed.  Why is eData set to valId  when it should return the id attribute value? How do I fix this issue?

-Thank You,

     Rich

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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