EasyUI Forum
May 21, 2024, 03:36:59 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Icon in edatagrid editor  (Read 10062 times)
finzaiko
Newbie
*
Posts: 44


View Profile
« 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 ?
Logged
aswzen
Sr. Member
****
Posts: 287


Indonesian

aswzen
View Profile WWW Email
« Reply #1 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);
        }
    }
});
« Last Edit: April 10, 2015, 12:42:40 AM by aswzen » Logged

Regards,
Sigit

- Indonesian jEasyUI Facebook page : https://www.facebook.com/groups/jeasyuiid/
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #2 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>
Logged
aswzen
Sr. Member
****
Posts: 287


Indonesian

aswzen
View Profile WWW Email
« Reply #3 on: April 10, 2015, 02:13:30 AM »

thank you Cheesy
Logged

Regards,
Sigit

- Indonesian jEasyUI Facebook page : https://www.facebook.com/groups/jeasyuiid/
finzaiko
Newbie
*
Posts: 44


View Profile
« Reply #4 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
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #5 on: May 19, 2015, 05:36:00 PM »

The validatebox component has not 'icons' property. Please use 'textbox' component instead.
Logged
finzaiko
Newbie
*
Posts: 44


View Profile
« Reply #6 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.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!