Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to correctly associate double click with the Edit?
Message
 
 
To
09/04/2013 21:26:52
General information
Forum:
Javascript
Category:
JQuery
Miscellaneous
Thread ID:
01570547
Message ID:
01570553
Views:
48
No, I don't think it's the reason. I don't even think that the parameters in these functions are required, I am going to try to remove them.

>edit function is expecting parameters that are not being passed from double click.
>
>
>>Hi everybody,
>>
>>I have the following script
>>
>>
>>function edit(com, grid) {
>>   $('.trSelected', grid).each(function () {
>>
>>      var id = $(this).attr('id');
>>      id = id.substring(id.lastIndexOf('row') + 3);
>>      currentId = id;
>>      $('#fntype').val('Edit');
>>      var ClientName;
>>      ClientName = $('.trSelected td:eq(2)').text();
>>      var url = '/Client/Edit/' + id;
>>
>>      $.get(url, function (html) {
>>         $($dlg).html(html);
>>      });
>>
>>      RunModalDialog("Edit Client: " + ClientName);
>>
>>   });
>>}
>>
>>which is invoked this way:
>>
>>
>>   buttons: [
>>   { name: 'Add', bclass: 'add', bimage: '../Content/Themes/FlexiGrid/Images/add.png', tooltip: 'Add new client', onpress: add },
>>   { name: 'Edit', bclass: 'edit', bimage: '../Content/Themes/FlexiGrid/Images/edit.png', tooltip: 'Edit selected client', onpress: edit },
>>   { name: 'Delete', bclass: 'delete', bimage: '../Content/Themes/FlexiGrid/Images/delete.png', tooltip: 'Delete selected client', onpress: del },
>>   { separator: true }
>>   ],
>>
>>
>>and I also want to be able to double click on the row and invoke the same action.
>>
>>So, I tried (I am using latest jquery):
>>
>>
>>$('#flexClients').dblclick(function () {
>>   edit();
>>});
>>
>>but nothing happens.
>>
>>I know that the code itself attaches the handle correctly to dblclick (if I change the edit to alert, it fires).
>>
>>So, what I am doing wrong here and how should I adjust the above?
>>
>>Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform