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
.live("click", handler) inside a grid
25/03/2010
16:12
Avatar
tibi7000
Member
Members
Forum Posts: 3
Member Since:
25/03/2010
sp_UserOfflineSmall Offline

Hello,

I've created a grid with buttons in one of the columns(for editing, deleting, printing). The problem is I cannot use .live Jquery function for the click event on these buttons.

   $("#cp3_linkedMOGrid").jqGrid({
    datatype:'local',
    colNames:['', 'MO name'],
    colModel:[
     {name:'icons', jsonmap:'icons', sortable:false, search:false, width:110},
     {name:'name', jsonmap:'name', index:'name', search:false, width:100}
    ],
    rowNum:5,
    sortname: 'name',
    sortorder: "desc",
    width:700
   });
   
  
   var rows = $("#cp3_linkedMOGrid").jqGrid('getDataIDs').length;
   $("#cp3_linkedMOGrid").jqGrid('addRowData', 'example'+rows,
    {
    icons: "<button class='cp3_editMO'></button>"
     +"<button class='cp3_deleteMO'></button>"
     +"<button></button>",
    name:'example'+rows
    } );
    
   
   $("button.cp3_editMO").live('click', cp3_editMO);
   $("button.cp3_deleteMO").bind('click', cp3_editMO);
   
   $("tr").live("click", cp3_editMO);

I'm using 3.6.4, with jquery 1.3.2 and UI 1.7.2.

I've also noticed that changing the event type(e.g. mousedown) or using bind works.

Is this a bug ?

Thanks a lot,

Tibi

31/03/2010
18:00
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

I will try to test it, but the first that I see is that the live function is called after addRowData and not before.

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.

01/04/2010
10:24
Avatar
tibi7000
Member
Members
Forum Posts: 3
Member Since:
25/03/2010
sp_UserOfflineSmall Offline

I tried calling live just after the grid creation, but it doesn't change a thing, it still doesn't work.

Thanks,

Tibi

03/04/2010
16:47
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Which version of jQuery is used?

Best 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/04/2010
10:01
Avatar
tibi7000
Member
Members
Forum Posts: 3
Member Since:
25/03/2010
sp_UserOfflineSmall Offline

tony said:

Hello,

Which version of jQuery is used?

Best Regards

Tony


I'm using JQGrid 3.6.4, with jquery 1.3.2 and UI 1.7.2.

Live works with the "click" event in this version, I've tested with a simple button outside the grid.

Tibi

08/04/2010
13:07
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Will try to reproduce this.

Best 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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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