2015-09-15 3 views
1

У меня есть кнопка внутри каждой строки таблицы, сгенерированной внутри цикла. Кнопка имеет класс click_link. Идентификатор будет отличаться для каждой строки. При нажатии на кнопке, диалоговое JQuery является created.I нужно идентификатор кнопки внутри click() диалоговых кнопок, то щелкните событие кнопки EditПолучить идентификатор кнопки, которая открывает диалог

$("#dialog_loader").dialog({resizable: false, 
    height:"auto", 
    modal: true, 
    minWidth: 500, 
    autoOpen:false, 
    buttons: { 
    "Edit": function() { 
     $.ajax({ 
      url:url1, 
      type:'POST', 
      data:data1, 
      success:function(msg){ 
       if(msg) 
       { 
        //alert(msg); 
       //Here I need to get the id of the button which creates 
       the dialog.That is id of the button with class **click_link** 
       } 
      } 
     }); 
    }, 
    Cancel: function() { 
     $(this).dialog("close"); 
    } 
    } 
}); 

//click event of button 
$(document).on('click','.click_link',function(){ 
    $("#dialog_loader").css({'display':'show'}); 
    $('#dialog_loader').dialog('open'); 
}); 
+1

http://stackoverflow.com/questions/14898765/pass-a-variable-to-jquery-ui-dialog – afrin216

ответ

0

Установите data() свойства Ид диалогового окна из

$('#dialog_loader').data('dialog_opener',"id of the button which create dialog").dialog('open'); 

Затем вызовите $("#dialog_loader").data("id of the button which create dialog") , где это необходимо

Смежные вопросы