EasyUI Forum
May 21, 2024, 12:12:22 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Emulate Datagrid Loading Message  (Read 22566 times)
loucarey
Newbie
*
Posts: 3


View Profile
« 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
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 14, 2013, 08:06:12 AM »

Displaying the progress message is one of the choices to solve this issue.
Code:
$.messager.progress(); 
//$.messager.progress('close');  // close the message window
Logged
loucarey
Newbie
*
Posts: 3


View Profile
« Reply #2 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.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: June 14, 2013, 09:33:20 AM »

Why not override the 'loadMsg' property to display your own message?
Logged
loucarey
Newbie
*
Posts: 3


View Profile
« Reply #4 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.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #5 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
$('#dg').datagrid('loading');  // display loading message
$('#dg').datagrid('loaded');  // hide loading message
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!