EasyUI Forum
September 14, 2025, 03:35:46 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: align linkbutton in datagrid  (Read 9808 times)
crosemffet
Jr. Member
**
Posts: 68



View Profile WWW Email
« 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....
« Last Edit: December 10, 2012, 06:05:08 AM by crosemffet » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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');
}
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!