Saturday, September 25, 2010

jQuery UI 1.8.5 released

jQuery 1.8.5 was release September 17th  http://blog.jqueryui.com/2010/09/jquery-ui-1-8-5/
This is a bug fix release mostly, but it has one powerful new feature that I've been waiting for.  We now have more power over the buttons on the dialog.  We can set them to primary and secondary buttons, as well as disabled.  The styles of these buttons are built into the theme.  There is ui-priority-primary, ui-priority-secondary, and ui-state-disabled.

Also the text on the button is no longer limited to a string, we can now include html, so if we wanted to bold a single word on a multiword button we could have something like “Find account” 

Here’s an example of how to use the new functionality,  
el = $("
").dialog({
                buttons: [
                                {
                                                text: "a button 1",
                                                "class": "ui-priority-primary",
                                                id: "my-button-id-1",
                                                click: function() {
                                                                alert("button 1 clicked");
                                                }
                                },
                                {
                                                text: "a button 2",
                                                "class": "ui-priority-secondary",
                                                id: "my-button-id-2",
                                                click: function() {
                                                                alert("button 2 clicked");
                                                }
                                }
                ]
});

No comments: