EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: crosemffet on December 10, 2012, 06:02:54 AM



Title: align linkbutton in datagrid
Post by: crosemffet on December 10, 2012, 06:02:54 AM
after some efforts, and read carefully differents posts, finally found how to add a link button inside a cell in a datagrid.
the problem now is the button doesn't show aligned with the rest of the row (and so looks really bad...)(please see the attached image...)
my code is:
...for the row:
<th data-options="field:'tasks',formatter:formatRowButton">Tasks</th>
... for the creation of the button
onLoadSuccess: function(data){
   //create the grid buttons
   $(this).datagrid('getPanel').find('a.gridButtons').linkbutton();
... and finally
function formatRowButton(val,row){
   return '<a href="#" class="gridButtons" data-options="plain:true">A Link</a>';
}
what's wrong with my code..?
in what place should I put the align instruction (top?.. middle.? bottom..?)
thanks in advance....


Title: Re: align linkbutton in datagrid
Post by: stworthy on December 10, 2012, 08:48:41 PM
Set rows with larger height value.
Code:
	<style type="text/css">
.datagrid-row{
height:35px;
}
</style>

Or call 'fixRowHeight' method after the linkbutton is created.
Code:
onLoadSuccess: function(data){
   //create the grid buttons
   $(this).datagrid('getPanel').find('a.gridButtons').linkbutton();
   $(this).datagrid('fixRowHeight');
}