-
12 Mar 2009 4:55 PM #1
how to add buttons in the grid of row
how to add buttons in the grid of row
hello
when i use a grid ,I want to add some buttons in the end of row,such as add,delete.
but i find It difficult to do this ,how can fix it
thanks
-
13 Mar 2009 12:57 PM #2
why you don't set the buttons at the topcomponent?
-
15 Mar 2009 5:12 AM #3
Struggle with that for some time. If you really want widgets in a Grid...you should use table instead.
-
15 Mar 2009 3:49 PM #4
For general information. It is always bad to have all the widget for each row. This blows up dom and makes the browser slower as needed. You should really overthink your application design if you need this.
-
15 Mar 2009 5:36 PM #5
You could use renderer to add button to the cell of the end of row. This might be not the best solution but i use it. The bad thing is i don't use unobtrusive js for the onClick part.
Here's my code to add link to cell. With a little modification, you could change the link to button.
As the previous reply above suggest, you'd better consider using tbar or bbar and add button to achieve your goal for deleting or editing row. Get the row data id and do something from single button.Code:{header: 'Nama', width: 130, dataIndex: 'nama', sortable: true, renderer: function(val,p,rec){ return "<a href='#' onClick=\"show_alert('" + rec.data.id + "')\">" + val + '</a>'; }}
Hope it helps.


Reply With Quote