EasyUI Forum
September 14, 2025, 08:59:30 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: set datagrid title without reloading results?  (Read 10455 times)
jpierce
Jr. Member
**
Posts: 73


View Profile
« on: June 18, 2013, 04:16:03 PM »

Is there some way to set the datagrid's title that doesn't cause it to reload the results?  When I do this:

mytable.datagrid({title:'foo'})

It always fetches the data from the server again.

As far as I can tell, the only way is to hack around it to change the element's text directly.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 18, 2013, 06:12:37 PM »

Get the panel object and then you will be able to do anything about panel.
Code:
var p = $('#dg').datagrid('getPanel');  // the panel object
p.panel('setTitle', 'newtitle');  // change the panel title
Logged
jpierce
Jr. Member
**
Posts: 73


View Profile
« Reply #2 on: June 19, 2013, 06:24:24 AM »

Thanks!  Obvious once it's pointed out  Cheesy
Logged
jpierce
Jr. Member
**
Posts: 73


View Profile
« Reply #3 on: June 19, 2013, 06:29:12 AM »

Hmm, actually, bit of a complication.  What if the grid didn't have a title to begin with, and you want to set the title?  When I use your code to set the title after the grid has loaded, it never shows up.  I tried calling

table.datagrid('getPanel').panel('open');

But that didn't do anything obvious.
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!