EasyUI Forum
May 20, 2024, 02:12:21 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: Linkbutton custom style via javascript [UNSOLVED]  (Read 6002 times)
aswzen
Sr. Member
****
Posts: 287


Indonesian

aswzen
View Profile WWW Email
« on: February 01, 2016, 05:31:37 AM »

Can we add link button custom style via javascript?

because for now there are no properties or options in linkbutton to do that,
and there are no method to attach ID either custom css class..

i have linkbutton generated by datagrid toolbars system and i want to change a linkbutton border size dynamically via javascript.
how to do that?

code:
Code:
 $('#DATAGRID_LIST').datagrid({
            data             : DATA_DETAILS,
            singleSelect     : true,
            fit              : true,
            toolbar          : [{
                plain     : true,
                text      : 'Add Package',
                iconCls  : 'icon-vendor',
                style     : 'float:right;border:2px solid black',  // <<<< not working
                handler  : function(){alert('Add Package')}
            }],
            columns:[[
                {field:'PACKAGE_GROUP_ALIAS',title:'Package',width:160,align:'left'},
                {field:'ATTACHMENT',title:'Attachment',width:460,align:'left'},
                {field:'SPEC_DESC',title:'Type / Location',width:350,align:'left'},
                {field:'ON_PENDING',title:'Status',width:100,align:'center'}
            ]]
        });
Thank you in advance
« Last Edit: February 25, 2016, 12:06:06 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 #1 on: February 01, 2016, 07:06:19 PM »

You should attach the 'id' property to the button and select it by id selector.
Code:
toolbar          : [{
    id     : 'btnAdd',
    plain     : true,
    text      : 'Add Package',
    iconCls  : 'icon-vendor',
    handler  : function(){alert('Add Package')}
}],
Logged
aswzen
Sr. Member
****
Posts: 287


Indonesian

aswzen
View Profile WWW Email
« Reply #2 on: February 01, 2016, 08:58:36 PM »

ok ID is fine but how to add custom class name?

because this one does not work
Code:
toolbar          : [{
    class : 'btnAdd', // <<<<<<< not working
    plain     : true,  // <<<<<<< i realized this one does not work too
    text      : 'Add Package',
    iconCls  : 'icon-vendor',
    handler  : function(){alert('Add Package')}
}],

i see your documentation have wrong example code
open documentation > datagrid > toolbar
you will see this code

<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true"/a>

it should be

<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true"></a>
« Last Edit: February 01, 2016, 09:10:06 PM by aswzen » Logged

Regards,
Sigit

- Indonesian jEasyUI Facebook page : https://www.facebook.com/groups/jeasyuiid/
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!