Lightweight jquery Framework--Toolbars (toolbar)

Source: Internet
Author: User

Toolbar requirements:

(1) requires that the toolbar be generated in JSON configuration format, which controls the state of the button at the UI level from the server side to control the generated JSON

(2) You can customize the icon style of the button.

(3) button events can be defined, and button events need to be supported as String definitions (server-side button JSON configuration events are configured as strings)

(4) Support toolbar global events, that is, click on any button to trigger the event

(5) Support for programmatically disabling, enabling, adding, deleting buttons

(6) Support configuration of additional event parameters, consider the parameters with permission flags

(7) Toolbars need to be considered for easy integration into the tree component, DataGrid, and other UI components that may need to be used in the toolbar

(8) If it is a server-side generation toolbar, in order to facilitate the management of toolbar events, consider defining the toolbar's events into an event collection under the current Page window object

Toolbar API Design:

One, josn configuration definition:

Global definition:

var defaultopts = {        params:{},// data parameter for the button to be integrated into the tree DataGrid        align: ' Left ',/ / alignment, default is left, center, right        style: ' normal ',//  Normal/min/plain        //        function () {}// events triggered by any button event, before the generic event is called, this= a tag    };

A single button definition:

 

buttons=[{ID:' 04 ',//Button IDICONCLS: ",//icon StyleCMD: ' Test ',//the corresponding permission IDParams:{pr1:123},//Additional ParametersStatu:false,//is availableText: ' button ',//textClick:function(PR) {//Click event, if there is a click, handler is not available in string form}, Handler:' Events in string form ',//Use with MethodsobjectMethodsobject: ' Event set noun under Window object '    }]

Second, the API definition

  

Third, toolbar preview

  

Code Download:

Https://code.csdn.net/hjwen/open-ui/tree/master

  

Lightweight jquery Framework--Toolbars (toolbar)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.