|
Title: Emulate Datagrid Loading Message Post by: loucarey on June 14, 2013, 04:11:30 AM Hi All,
This is my first post. I have been using EasyUI for about 3 weeks now and find it to be a godsend - great work by the coders! Here's my question: I have two columns in my datagrid, one that displays an up arrow, the other a down arrow (see attached image). When the up arrow cell is clicked for any given row, a JQuery ajax call is made to a PHP script to move that row up in the grid's MySQL database table (using a display order field to determine position). Then, the grid is reloaded using the grid's 'reload' method and the row which was moved is selected using the grid's 'selectRecord' method. The same principle is used when a down arrow is clicked. In the time gap between the move and reload, I would like to show a message, similar the the grid's built-in loading message, to show that the row is being moved. Any suggestions? Thank you, Lou Title: Re: Emulate Datagrid Loading Message Post by: stworthy on June 14, 2013, 08:06:12 AM Displaying the progress message is one of the choices to solve this issue.
Code: $.messager.progress(); Title: Re: Emulate Datagrid Loading Message Post by: loucarey on June 14, 2013, 08:14:03 AM Thank you for the reply and suggestion. I did look at this as an option but was not satisfied with the look and feel of it.
Title: Re: Emulate Datagrid Loading Message Post by: stworthy on June 14, 2013, 09:33:20 AM Why not override the 'loadMsg' property to display your own message?
Title: Re: Emulate Datagrid Loading Message Post by: loucarey on June 14, 2013, 09:37:19 AM Is that a property of the datagrid? If so, I don't think it will work because the process for which I need a message to display is an ajax call which I call before the datagrid reload. I'm actually manipulating data in the datagrid's back end with the ajax call and then reloading the updated rows.
Title: Re: Emulate Datagrid Loading Message Post by: stworthy on June 15, 2013, 07:36:44 AM The 'loadMsg' property is defined in datagrid. The 'loading' and 'loaded' methods can be used to display or hide the loading message window. You can combine them together in runtime to do what you want.
Code: $('#dg').datagrid('options').loadMsg = 'other message'; // change to other message |