Splicing of textField field in easyui combobox

To get the effect of the following figure: The splicing of provinces and cities

1. The data in the database is shown in the figure:

 

2.combobox 

<td>Select Region</td>
                            <td>
                                <input type="text"
                                 class="easyui-combobox" 
                                 id="areaType"
                                name="area.id" 
                                editable="false"
                                data-options="required:true,valueField:'id',textField:'name',
                                url:'../../area_list.action'" />
                            </td>

2. Use js code for splicing:

                 $('#areaType').combobox({
                    formatter:function(row){
                        return '<span class="item-text">'+row.province+row.city+row.district+'</span>';
                    }
                })

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325137681&siteId=291194637