1

グローバリゼーションの目的で、jquery ダイアログのボタンを翻訳する必要がありますが、変数を渡そうとすると、変数の値が取得されず、変数の名前だけが取得されます。

    var RemoveDialogButton = "@FriendsNamesNS.FriendsNames.Remove";
    var CancelDialogButton = "@FriendsNamesNS.FriendsNames.Cancel";

   //alert(RemoveDialogButton);

   $( "#dialog-confirm" ).dialog({
        autoOpen: false,
        resizable: false,
        height:190,
        modal: true,
        buttons: {
        RemoveDialogButton: function() {
             $( this ).dialog( "close" );
            $('#yesno').click();
            return true;
        },
        CancelDialogButton: function() {
        $( this ).dialog( "close" );
        }
      }
    });
4

2 に答える 2

1
RemoveDialogButton: {
      click: function() {
          $( this ).dialog( "close" );
          $('#yesno').click();
          return true;
      },
      text: RemoveDialogButton
}
于 2013-02-28T13:29:13.423 に答える
0
 var buttons= {};
 buttons[your text] = function() { ....};


 $('.selector').dialog({      
   buttons: my_buttons 
  });
于 2013-02-28T13:34:34.140 に答える