Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Tree Grid database SQL - demo bug
12/06/2009
00:38
Avatar
cristib
Member
Members
Forum Posts: 21
Member Since:
18/03/2009
sp_UserOfflineSmall Offline

Hi,

There is posted anywhere the SQL for Tree grid side ?

Currently the downloadable demo does not include the sql for the tree grid, only for normal grid.

12/06/2009
01:17
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

You can look in server.php - case 'tree' :

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.

12/06/2009
01:20
Avatar
cristib
Member
Members
Forum Posts: 21
Member Since:
18/03/2009
sp_UserOfflineSmall Offline

Thanks,

Congrats for a great grid 🙂

12/06/2009
03:22
Avatar
zerikv
Member
Members
Forum Posts: 9
Member Since:
12/06/2009
sp_UserOfflineSmall Offline

Hi,

Have you the sql commands to create and populate the table "accounts" ?

This table is needed to run the treeview sample, but the sql is not in the zip jqGrid-3.5.beta-demo.

Thanks,

12/06/2009
03:24
Avatar
cristib
Member
Members
Forum Posts: 21
Member Since:
18/03/2009
sp_UserOfflineSmall Offline

I think that's it:

CREATE TABLE IF NOT EXISTS `accounts` (
  `account_id` int(11) NOT NULL AUTO_INCREMENT,
  `parent_id` int(11) DEFAULT NULL,
  `name` varchar(128) NOT NULL,
  `acc_num` varchar(128) NOT NULL,
  `debit` int(11) NOT NULL,
  `credit` int(11) NOT NULL,
  `balance` int(11) NOT NULL,
  PRIMARY KEY (`account_id`)
) ;

12/06/2009
03:41
Avatar
zerikv
Member
Members
Forum Posts: 9
Member Since:
12/06/2009
sp_UserOfflineSmall Offline

Thank cristib for your quick reply

It seems miss some columns like "level", "rgt" and "lft" to select sub-tree in the table. These columns are a bit tricky to calculate. Do you have the insert commands or could you point me where I can find them ?

12/06/2009
03:50
Avatar
cristib
Member
Members
Forum Posts: 21
Member Since:
18/03/2009
sp_UserOfflineSmall Offline

The create table i sent you is for adjiacent model, not for nested table model.

Take a look on the mentioned file to see about them....

12/06/2009
04:46
Avatar
zerikv
Member
Members
Forum Posts: 9
Member Since:
12/06/2009
sp_UserOfflineSmall Offline

Thanks cristib for your help

Finally to run the treeview demo I have added 3 columns in the create command  above

  `level` int(11) NOT NULL,
  `lft` int(11) NOT NULL,
  `rgt` int(11) NOT NULL, 

and inserted the following data test:

INSERT INTO accounts VALUES(1,NULL,'A1'   ,100001,11,12,13,0,1,14);
INSERT INTO accounts VALUES(2,1,   'A11'  ,100011,111,112,113,1,2,3);
INSERT INTO accounts VALUES(3,1,   'A12'  ,100012,121,122,123,1,4,11);
INSERT INTO accounts VALUES(4,1,   'A13'  ,100013,131,132,133,1,12,13);
INSERT INTO accounts VALUES(5,3,   'A121' ,100121,1211,1212,1213,2,5,8);
INSERT INTO accounts VALUES(6,3,   'A122' ,100122,1221,1222,1223,2,9,10);
INSERT INTO accounts VALUES(7,5,   'A1211',101211,12111,12112,12113,3,6,7);

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
35 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information