参见英文答案 >
How can I disable a button on a jQuery UI dialog?14个
我一直在使用JQuery UI对话框.我正在使用以下代码.任何人都可以让我知道如何在点击后隐藏导出按钮
我一直在使用JQuery UI对话框.我正在使用以下代码.任何人都可以让我知道如何在点击后隐藏导出按钮
- $( "#dialog-confirm1" ).dialog({
- resizable: false,height:350,width:650,modal: false,autoOpen:false,buttons: {
- "Export": function() {
- exportCSV(2);
- },Cancel: function() {
- $( this ).dialog( "close" );
- }
- }
- });
解决方法
您可以使用$(‘.ui-button:contains(Export)’).hide():(以下代码在您单击时隐藏导出按钮)
- $( "#dialog-confirm1" ).dialog({
- resizable: false,buttons: {
- "Export": function() {
- exportCSV(2);
- $(event.target).hide();
- },Cancel: function() {
- $( this ).dialog( "close" );
- }
- }
- });