Sigma Php Ajax framework, Ajax Components, GUI Builder
May 23, 2012, 07:46:31 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Tutorial 7 - Programming With Tree Grid  (Read 5345 times)
steven
Moderator
Hero Member
*****
Posts: 544



View Profile
« on: February 12, 2009, 01:38:44 AM »


If you have read Tutorial 6, things of this tutorial could become easier.  What's difference between tree and tree grid? No difference. Let's do something to prove it.

[Req Spec]
An tree grid with unlimited rows.
When end user expand a row, grid shows its children rows; end user could expand one of the children rows, grid shows its grandson rows; and so on...

[Do It Yourself]
1. Drag an [treeGrid] to design area, set [alias] to "treegrid1"(Click [input] to select it, type "treegrid1" in [Component Config Window]->[alias],and strike [Enter] on keyboard).
3. Set [rows] of "treegrid1" to the following code. (Click "treegrid1" to select it,click on right side of [Component Config Window]->[properties]->[rows],a small button will appear. Click this button, a dialog box will pop up.)
4. You will see some default lines in the dialog. Generally, we could change it  to the following code. I think you guys understand what this mean to grid -- this is a 2d array, please show them in two rows.

This time, I would like to change a little, just like the following code.

As you can see, I add a "sub" to the second row, which tells grid "oh, the second row is parent row, it has children".
5. Set [onGetContent] of "treegrid1" to the following code. (Click "treegrid1" to select it,click on right side of [Component Config Window]->[event]->[onGetContent],a small button will appear. Click this button, a dialog box will pop up.)
6. You could see something like this.

As same as tree, this function will be called when end user expand a parent row. Change the code to the following.

6. Click [OK] to close dialog.
7. Press [run] to see the result. If everything goes well, you will see a grid with unlimited rows.
8. If you want to do with real database, just change code in step 5 to

Be sure that treegrid.php take the following string back
Logged

Sigma AJAX Data Grid - Easy to Integrate with PHP, ASP Classic, ASP.NET & Java
Sigma PHP Ajax Framework - WYSIWYG GUI Builder With Tree, Grid, Treegrid, Dialog, Tab & More Component
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!