$grid->render_table

Hi, i have a problem with my customized grid.

I took the sample and added columns. And modified the database. It All works great, but for some reason my data isnt showing right.

See http://fingerbeton.cwsurf.de/1/samples/grid/01_basic.html The Data is moved one column to the left.

i think the problem is located in the basic_connector.php:

$grid->render_table("grid50000","angebots_nr","plz,bauvorhaben,firma,eingang,sub,ausgang,ergebnis");

but for some reason, its not showing angebots_nr. It starts showing @ plz.

Can someone help me with this?

Thanks in advance

tyron

ID field is not rendered in grid, it is an expected use-case ( because making ID visible or editable creates a confusing situation , when client side rows can’t be linked to related DB records )

If you are using grid only for loading, you can duplicate ID in list of fields

$grid->render_table(“grid50000”,“angebots_nr”,“angebots_nr,plz,bauvorhaben,firma,eingang,sub,ausgang,ergebnis”);

If you plan to use grid for editing as well - check
viewtopic.php?f=10&t=12012

Hello! Thanks for your quick reply. I think i found my problem as well. I forgot to put an id field with auto_increment in the database. after i done that it works!

I want to use this script to view/edit/add…is this the wrong script that i am using?

If you are using ID field only as row-ID and not plan to show it as column in grid - default version of dhtlmxconnector will work fine. ( because you are using auto-increment field - it seems as your case )

If you need to show and edit the ID data on the client side - alternate connector class can be used ( can be taken from link in previous post ), also it can be used when ID is non-auto-increment.

Thanks again for your quick reply. I won’t have to edit or show the row id. So i will work on with this script…

I have one more last question for now. Since im not very good at scripting, does anyone know, if i can start this script with 20-30 rows allready showing (blank) so i dont have to add a row everytime? Lets say like Excel has… Or wont this work with this script?

I would like to make this script work like excel.

greetings tyron

The only way to have such functionality and auto-saving by connector - add some count of empty records to the database - so they will be shown as empty rows in client side grid as well.