Change the Jquery Dialog Button Text -


i need change text of dialog button have 3 dialog buttons me , need change 1 of them.

i have jquery code:

$("dialog").dialog({ height: 600, width: 1000, modal: true, resizable: false, buttons: {      "upload": function() {            alert("upload");       }      "edit": function() {            $('#dialog').dialog("option", "buttons",[                     {                         text: "save",                         click: function () {                             alert("save");                         }                      }                 ]);       }      "delete": function() {            alert("delete");       } } 

this solution change edit button save button removes upload , delete button. may add upload , delete again inside edit function think doesn't way.

please let me have better solution this.

thank you.

you can assign class button when create it, giving nice clean way reference it.

here's working example on jsfiddle , revised code:

$("#dialog").dialog({ height: 600, width: 1000, modal: true, resizable: false,         buttons:             [               {                   text: "upload",                   click: function() {                      alert("upload");                   }               },               {                   text: "edit",                   click: function() {                     $(".editbutton > .ui-button-text").text("save");                    },                   'class': 'editbutton'               },                 {                   text: "delete",                   click: function() {                      alert("delete");                   }               }             ]     }); 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -