EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: iLLuSia on January 07, 2017, 09:47:35 AM



Title: Combotreegrid custom textField not working
Post by: iLLuSia on January 07, 2017, 09:47:35 AM
I had a combogrid, which looked like this:
Code:
$('#cg').combogrid({
            idField:'id',
            textField:'custom_desc',
            columns:[[
              {field:'desc1', title:'Description1', width:50},
              {field:'desc2',title:'Description2',width:200}
            ]]
        });
Where as the user selected a value, the "custom_desc", which is composed from multiple columns, appeared in the combo field.

Now I've updated to combotreegrid and this is no longer working. The parameter "treeField" replaces "textField" and only this one column is displayed in the box, when a value is selected, textField is ignored. I've tried to work around with "onSelect" method, but it doesn't work either. onHidePanel is working fine, if the panel is closed without selecting anything. On the other hand though, when selecting, onSelect is fired twice with onHidePanel once inbetween, and "setText" is ignored everywhere. To be precise: it's not completely ignored, it's stored as the combotreegrids text, but it's not displayed in the combo. Instead the "treeField" is displayed.

Is this a bug or am I doing something wrong? Here's the code:

Code:
$('#cg').combotreegrid({
            idField:'id',
            treeField:'desc1',
            textField:'custom_desc',
            columns:[[
              {field:'desc1', title:'Description1', width:50},
              {field:'desc2',title:'Description2',width:200}
            ]],
            onSelect: function(row) {
            console.log("onSelect");
            $('#cg').combotreegrid('setText', 'something got selected...');
            },
            onHidePanel: function() {
            console.log("onHidePanel");
            $('#cg').combotreegrid('setText', "PANEL HIDDEN  AJAJAJAJAJ");
            }
        });


Title: Re: Combotreegrid custom textField not working
Post by: stworthy on January 08, 2017, 03:40:19 AM
The 'textField' property does not exist in combotreegrid component. To use this feature, please try to download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.5.1-patch.zip.