TableGear Help

a place to get help

Moderator: 1.2 Moderators

Forum rules
  • Every time you need help create a new thread (but please use the search function before, as your problem maybe has already been solved)
  • use code highlighting (help)
  • After your problem has been solved you have to rename the subject to "[solved] <Topicname>" AND set the Topic icon as solved (the green check)

TableGear Help

Postby Bowser on Tue Sep 08, 2009 4:33 pm

Hello everyone.

I'm starting this thread to offer help to TableGear users, and to allow them to help themselves.
I was managing this on my blog, but it started to get unmanageable, as well as code highlighting issues with wordpress, etc.

Please post problems you're having here, and I'll get to them as soon as I can. Also, if you have help for others, please post that as well.

Thank you.

Andrew
http://www.andrewplummer.com/tablegear/
Bowser
mootools connoisseurs
 
Posts: 38
Joined: Thu Oct 09, 2008 3:13 am

Re: TableGear Help

Postby ltdeta on Thu Sep 17, 2009 8:54 am

how can apply the sort order when the page loads?

i am using "tablegear.js" only
ltdeta
 
Posts: 12
Joined: Mon Aug 25, 2008 5:09 pm

Re: TableGear Help

Postby Bowser on Thu Sep 24, 2009 2:09 am

Hello... adding sorting is very simple:

  1. <script type="text/js">
  2.   new TableGear("tableID");
  3. </script>


Have a look here for more info (the demo link was broken but I fixed it, so that should make it easier):
http://www.andrewplummer.com/code/tablegear/example1.html

Cheers!
Bowser
mootools connoisseurs
 
Posts: 38
Joined: Thu Oct 09, 2008 3:13 am

Re: TableGear Help

Postby ltdeta on Thu Sep 24, 2009 3:26 pm

i have no problem getting it work ;)
i want to set the ascCarat column by default (the ascCarat shoud be visible at first time)

using only TableGear.js not TableGear.php
ltdeta
 
Posts: 12
Joined: Mon Aug 25, 2008 5:09 pm

Re: TableGear Help

Postby elitefox on Mon Sep 28, 2009 7:29 am

Good Day Sir,

I was wondering if I can change the title of any of the column and choose what column to display?


TIA,
elitefox
elitefox
 
Posts: 1
Joined: Mon Sep 28, 2009 5:06 am

Re: TableGear Help

Postby Bowser on Sun Oct 04, 2009 6:07 pm

@itdeta If you want to do that, then apply the sort by calling the method .sort();

The idea is that if you are pre-sorting your data server-side, you should have the ascCarat in place already when the JS fires up... just makes things a bit neater...
Bowser
mootools connoisseurs
 
Posts: 38
Joined: Thu Oct 09, 2008 3:13 am

Re: TableGear Help

Postby Bowser on Sun Oct 04, 2009 6:11 pm

@elitefox, yes you can... have a look at the "headers" option of TableGear.php

As for choosing the columns, you can either pass in a "columns" array in "database" of the constructor, or you can use a custom query using TableGear->fetchDataArray('QUERY SQL HERE')
Bowser
mootools connoisseurs
 
Posts: 38
Joined: Thu Oct 09, 2008 3:13 am

Re: TableGear Help

Postby fackz on Fri Oct 16, 2009 9:51 pm

I have uploaded a test file here:

http://www.kbytes.com.br/tbgear/

I can't see the option to Add a new row...how can I do it?!
fackz
 
Posts: 1
Joined: Fri Oct 16, 2009 9:49 pm

Re: TableGear Help

Postby Rudolpho on Wed Nov 04, 2009 12:15 am

Hello!

Is there a possibility to make the tables editable only to certain persons?

my table looks like this:

member_id | data1 | data2 | data3 | data4 |


data3 and data4 are colums that are editable

my goal: i can get a user id from login session and want to make fields only editable if member_id == user_id

anyone got a suggestion?
Rudolpho
mootools connoisseurs
 
Posts: 25
Joined: Wed Nov 04, 2009 12:08 am

Re: TableGear Help

Postby Bowser on Wed Nov 11, 2009 4:21 pm

Sorry to everyone for taking so long to respond... I get incredibly busy...

@rudolpho that's an interesting problem.... I think it should be possible...

TableGear shouldn't have to worry about authentication... it should just accept the parameters you pass, so you should be able to pass the editable fields you want in the constructor. Since the parameters are a simple associative array, you can set that up before instantializing TableGear like this:

  1. $options = array('database' => array()..{etc});
  2. if($authenticated) $options['editable'] = array('col1', 'col2');
  3. new TableGear($options);

Something like that should do the trick!

@fackz ... looks like you took the link down... sorry to take so long!

I don't know your exact problem, but the new version of table gear (v1.5) supports new rows just by stepping into them with the keyboard... give it a shot on the demo page!
Bowser
mootools connoisseurs
 
Posts: 38
Joined: Thu Oct 09, 2008 3:13 am

Next

Return to Help

Who is online

Users browsing this forum: Google [Bot] and 3 guests