EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Opan Mustopah on January 13, 2015, 07:46:38 AM



Title: how to make panelWdith combogrid same with textfield width
Post by: Opan Mustopah on January 13, 2015, 07:46:38 AM
night all,
oke the title say's all.

how to make it happen? in case i have set my textfield width with percentage like 100% or it mean textfield width is following parent element width?

many thanks for the answer
 


Title: Re: how to make panelWdith combogrid same with textfield width
Post by: stworthy on January 13, 2015, 08:31:36 AM
Just set the 'panelWidth' property to 'auto'.
Code:
$('#cg').combogrid({
  panelWidth:'auto'
});


Title: Re: how to make panelWdith combogrid same with textfield width
Post by: Opan Mustopah on January 13, 2015, 08:44:01 AM
thanks stworthy for quick replay,
i'll try it soon.


Title: Re: how to make panelWdith combogrid same with textfield width
Post by: Opan Mustopah on January 13, 2015, 08:02:47 PM
sorry stworthy, but it isn't working with me,,

see bug panelwidth.png:

as you can see , panel combogrid just shown as straight line, when i set panelWidth with 'auto'.
as my code below:

Code:
tipPosition:'top',
            url:'#{lookup_menu_path}',
            mode:'remote',
            method:'get',
            fitColumns:true,
            panelWidth:'auto',
            textField:'namamenu',
            idField:'id_menu',
            onShowPanel:function(){return rowHeight(this);},
            columns:[[{field:'namamenu',title:'Title', width:100,sortable:true}]]

many thanks for the answer


Title: Re: how to make panelWdith combogrid same with textfield width
Post by: stworthy on January 14, 2015, 12:18:15 AM
Please refer to this example http://jsfiddle.net/rbsb79t2/. It works fine.


Title: Re: how to make panelWdith combogrid same with textfield width
Post by: Opan Mustopah on January 14, 2015, 08:41:39 AM
yes it works fine when you set width element with fixed size, but when you set width element with  percentag like 100%, 80%, it only show the straight line,

see your jsfiddle, i do some modification.
http://jsfiddle.net/rbsb79t2/1/

i change width in originally form you is 350, to 100%.


Title: Re: how to make panelWdith combogrid same with textfield width
Post by: stworthy on January 14, 2015, 07:54:31 PM
Please try the updated example http://jsfiddle.net/rbsb79t2/2/


Title: Re: how to make panelWdith combogrid same with textfield width
Post by: Opan Mustopah on January 14, 2015, 09:37:57 PM
now it works :D
thanks stowrthy.

but can you help me with this, http://www.jeasyui.com/forum/index.php?topic=4367.msg10485#msg10485

i still have a problem.