Wednesday, February 11, 2015

JQuery Scrap

$("#myDialog").dialog({
  buttons :  { 
     "MyButton" : {
         text: "OK",
         id: "okbtnid",
         click: function(){
             var bValid = true;
         }   
      } 
   }
});
 
 
Specify class name to your dialog, and select UI buttons from the class.
$('#foo').dialog({
    buttons: {
        CANCEL: function() {
            alert(1);
        }
    },
    dialogClass: 'my-dialog'
});
$('.my-dialog .ui-button-text:contains(CANCEL)').text('CLOSE');
 
 
 
 
*  Try this line to add the trash icon to the delete button. 
1. $('.ui-dialog-buttonpane').find('button:contains("OK")').prepend('<span style="float:left;" class="ui-icon ui-icon-trash"></span>'); 
 



To align the Trash Icon alongwith the button
2. $('.ui-dialog-buttonpane')
                            .find('button:contains("OK")')
                            .removeClass('ui-button-text-only')
                            .addClass('ui-button-text-icon-primary')
                            .prepend('<span class="ui-icon ui-icon-trash"></span>');

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More