Home  >  Article  >  Backend Development  >  After easyui combobox remotely loads data, insert an "all" in front

After easyui combobox remotely loads data, insert an "all" in front

WBOY
WBOYOriginal
2016-08-08 09:30:511813browse

            var relation_id_sign = 0;//标签

            $("#relation_id").combobox({
                url: 'set_url('relation', 'relation', 'get_relationGroupJson'); ?>',
                method: 'get',
                valueField: 'id',
                textField: 'relation_name',
                editable: false,
                panelHeight: 'auto',
                onLoadSuccess: function() {
                    if (relation_id_sign == 0)
                    {
                        var data = $(this).combobox('getData');
                        data.insert(0, {'id':'0','relation_name':'全部'});
                        relation_id_sign++;
                        $("#relation_id").combobox("loadData", data);//重新加载数据,且当 relation_id_sign==1时加载
                    }
                }
            });

以上就介绍了easyui combobox远程加载数据后在前面插入一条“全部”,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn