Forum
Topic RSS
23:17
22/12/2008
OfflineI had downloaded 3.5.1 and played with it. I spend my week end reading jqGrid document and I learned a lot. I got 2 problems:
1 – I used the integrated Search Toolbar sample with a dropdown that get its data from server. It works great, but I wanted also to refresh the data in the toolbar each time that I edit a row, or adding a new record. I couldn’t find any event , I added mygrid.filterToolbar(); and the grid add another row of toolbar with data refreshed, so I reemoved firs then add the Toolbar. $('tr.ui-search-toolbar', 'table.ui-jqgrid-htable').remove();
Is there a better way to refresh dropdwon list in the toolbar?
2 - I set the Edit form with selecting a ROW. All went well except delete. To delete a row you have to select a Row and in my case selecting a row brings the edit form. So I decided to add Delete button in the form as well. I could not find a built in function or property to add the button. For this reason I coded a new form. In afterShowForm event I added the following code:
afterShowForm: function(form) {
var deletelink = '<a id="dData" class="fm-button ui-state-default ui-corner-all fm-button-icon-left" ';
deletelink += 'href="javascript:void(0)"> ';
deletelink += 'Delete<span class="ui-icon ui-icon-trash"/></a>';
$('td.navButton', 'tr#Act_Buttons').empty().append(deletelink);
// I removed the Previous Next link and add Delete icon and save the current Row Id in a global variable RowID
rowID = id;
then I added a live click event to this link:
$('a[id=dData]').live('click', function() {
$('div[id=editmodmyList]').remove(); // close the Edit form
$('div.jqmOverlay').remove(); // remove the overlay
$('#myList').delGridRow(rowID); // delete the row and reload the delete button works great as expected. I hava little problem.in order to refresh data in the toolbar, I added afterSubmit event of delGridRow, but the code call server to refresh the toolbar, but it doesn’t refresh the grid, nor close the delete form. Am I doing something wrong? I would really appreciate any help to make those requirement, specially if there are easier way to make it. Thanks
08:06
Moderators
30/10/2007
OfflineHello,
1. Every id of the generated element when we have search toolbar is a combination of gs_ + the name from colModel
So if you have name myselect the correspnding element in toolbar search select is gs_myselect
2. I suppose you use onSelectRow to call editGridRow - right?
I suggest you to use onCellSelect event and to add additional button at left or rigth to delete a row.
When the user click you can identify which cell is clicked and lunch the appropriate action
Best Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 994
Currently Online:
17 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66
Log In
Home