About the problem of easyui's combobox multi-select additional separator

       Sometimes, there may be such requirements in the development process, such as the following figure:

       We may have multiple selections in a column of data in easyui's datagrid, which uses the multiple selection function of combobox. If the data is selected during the onClickRow time It is displayed in the combobox above, and then the update operation is performed, and some problems may occur later.

       For example, if the data in this row is 0, I don't want it to be displayed. Maybe due to business requirements, 0 is not the data we want. At this time, we may let the combobox display nothing. If we call the setValues ​​method of the combobox at this time to assign an empty string "", and then when re-selecting the value in the drop-down list, there is a problem with a separator at the beginning, as shown below.

     This extra separator is a big and big obstacle for us to process data in the background. It can be processed but some useless code needs to be written. In fact, it is very simple to solve this problem, just don't assign an empty string when setValues, but an empty array[]. Problem solved easily.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326561505&siteId=291194637