Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to correctly associate double click with the Edit?
Message
De
10/04/2013 11:57:25
 
 
Information générale
Forum:
Javascript
Catégorie:
JQuery
Divers
Thread ID:
01570547
Message ID:
01570624
Vues:
22
>>>>>>>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.
>>>>>>
>>>>>>So the function gets called. What do you mean by 'nothing happens' ? Debug/Single step it.
>>>>>
>>>>>I mean it passes through the first line and then immediately to the last. It doesn't go inside the function body in the .trSelected part. I find it very hard to follow jQuery code so I usually try to do a step out.
>>>>
>>>>If it's not stepping into code after "$('.trSelected', grid).each(function () {" then it's obviously not finding any items for the 'each'. Do '.trSelected' and 'grid' both give valid values ?
>>>
>>>It looks like I am back to the problem we discussed here message #1557273
>
>grid is undefined. I am not sure how to check trSelected - it seems like a text to me.

Try $('.trSelected') in the watch window....

>
>Here is my current code - the alert fires, but nothing after that:
>
>function bindDblClick() {
>   $('#flexClients tr').dblclick(function () {
>      alert('Double Click');
>      edit('Edit');
>   });
>}
>
>//$('#flexClients tr').dblclick(function () {
>//   alert('dblclick');
>//   edit();
>//});
>
>
>
>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);
>
>   });
>}
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform