JQuery UI: How to call a widget function with its namespace

后端 未结 3 1554
半阙折子戏
半阙折子戏 2021-02-05 08:44

I created two custom JQuery UI widgets with same name but with different namespaces as given below: First widget:

$.widget(\'finance.dialog\',{....}); // this wa         


        
3条回答
  •  隐瞒了意图╮
    2021-02-05 09:16

    You can invoke a jQuery UI widget by its namespace like this:

    $.ui.dialog(null, $('div#something'));  // Default jQ UI dialog
    $.finance.dialog(null, $('div#something'));  // Your first custom dialog
    $.hr.dialog(null, $('div#something'));  // Your second custom dialog
    

    Use the first parameter, which is null in the example above, to send any options to the widget.

提交回复
热议问题