easyui (combobox or combogrid) in the drop-down box click elsewhere when it will retract, the desired effect is a drop-down box has been expanded state

 

 

Requirements: Users click on the left side, right side of the display the user can click on, to the effect of group members add QQ group similar
design ideas: relying easyui comes Combogrid achieve, combogrid have onSelect method, can trigger an action in the drop-down box to select options when this time with

  $ ( "# xxx") combogrid ( "setValue", item);. // to be re-assigned (this place needs a re-assignment)
  var gridData = $ ( '# BaseCustomerIdsCom') combogrid ( 'Grid');. / / data acquisition table object
  var rowData = gridData.datagrid ( 'getSelected' ); // Get the selected row

}
Can obtain the data of the current line, the data can be assigned to the right side, the right side portion thereof will be omitted

Difficulties encountered:

He has been in a drop-down box wanted to pull down the state, people may ask why do not datagrid component, because combogrid own search function, using this feature will be easy to use with combogrid some unique problems to be solved is to keep the drop-down box click on the other local time recovery.
The idea initially is to capture the overall click event, which added $ ( '# xxx') combobox ( 'showPanel');.
The actual is not ideal, because the still will close look at the click of the rest of the time, and then show effect does not look good
// click event to capture the overall
$ (the Document) .on ( 'the click', function (E) {
$ ( '# BaseCustomerIdsCom') the ComboBox ( 'showPanel');.
});
back to find for a long time, been looking for is not to the appropriate solution, check out the official documentation there is no corresponding content
finally found, in fact combox the panel have the function of a onClose, to be triggered when the panel is closed, the display panel attempts to join what will happen? Try and difficult to resolve
$ ( '# xxx') the ComboBox ( 'Panel') Panel.. ({
OnClose: function () {
. $ ( '# Xxx') the ComboBox ( 'showPanel');
}
})

Guess you like

Origin www.cnblogs.com/ack6165/p/11543401.html