EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: finzaiko on August 24, 2014, 07:49:03 PM



Title: Icon in edatagrid editor
Post by: finzaiko on August 24, 2014, 07:49:03 PM
I want to make a browse / lookup function on edatagrid, how to insert an icon in texteditor as below image which can be clicked to show dialogbox ?
(http://i.cubeupload.com/9gHHKi.png)


Title: Re: Icon in edatagrid editor
Post by: aswzen on April 10, 2015, 12:29:47 AM
i need this feature

have anyone achieved it?

already tried with this, but looks odd
Code:
$.extend($.fn.datagrid.defaults.editors, {
    lookup: {
        init: function(container, options){
            var input = $('<input type="button" class="datagrid-editable">').appendTo(container);
            return input;
        },
        destroy: function(target){
            $(target).remove();
        },
        getValue: function(target){
            return $(target).val();
        },
        setValue: function(target, value){
            $(target).val(value);
        },
        resize: function(target, width){
            $(target)._outerWidth(width);
        }
    }
});


Title: Re: Icon in edatagrid editor
Post by: stworthy on April 10, 2015, 12:43:52 AM
Add the 'icons' property on a textbox editor to display icon buttons.
Code:
<th data-options="field:'attr1',width:250,
        editor:{
            type:'textbox',
            options:{
                icons:[{
                    iconCls:'icon-add',
                    handler:function(){
                        //...
                    }
                }]
            }
        }
        ">Attribute</th>


Title: Re: Icon in edatagrid editor
Post by: aswzen on April 10, 2015, 02:13:30 AM
thank you :D


Title: Re: Icon in edatagrid editor
Post by: finzaiko on May 19, 2015, 07:59:08 AM
Why it not work for me as below, the icon not show :
Code:
.......
 {field: 'val', title: 'Value(%)', sortable: true, width: 100, editor:{
                    type:'validatebox',
                    options:{
                        icons:[{
                            iconCls:'icon-add',
                            handler:function(){
                                alert('test');
                            }
                        }]
                    }
                }},
........
I use the latest edatagrid http://www.jeasyui.com/extension/edatagrid.php


Title: Re: Icon in edatagrid editor
Post by: stworthy on May 19, 2015, 05:36:00 PM
The validatebox component has not 'icons' property. Please use 'textbox' component instead.


Title: Re: Icon in edatagrid editor
Post by: finzaiko on May 19, 2015, 07:14:27 PM
Thanks a lot,

The problem is I use bootstrap theme not default theme, when I use default theme worked perfectly.