Closed Thread Icon

Topic awaiting preservation: Grid (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8590" title="Pages that link to Topic awaiting preservation: Grid (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Grid <span class="small">(Page 1 of 1)</span>\

 
SmashHallon
Nervous Wreck (II) Inmate

From: Sweden
Insane since: Mar 2003

posted posted 03-30-2003 08:35

I want to create a dynamic grid in DHTML/Javascript.
I want to be able to add new records in the grid, and edit and delete records.

Is there any free dhtml-grid already made that anyone know of?
Or a simple system of making it.

Here is a picture of a grid from Visual DATAFLEX like i want it: http://www.wssoftware.se/grid.gif

Thanks in advance
/Niklas

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 03-30-2003 18:07

Looks to me like you want a table.

Create a table and set its width and height to the size of the box you want. Give it the CSS property overflow:auto; to create the scrollbar(s) when its contents get too big to fit inside it. Use <th> tags for the table headers, and style them appropriately to create the 3D look. Then use the DOM to manipulate the table with javascript.

SmashHallon
Nervous Wreck (II) Inmate

From: Sweden
Insane since: Mar 2003

posted posted 03-31-2003 18:30

But i want to be able to add records to the GRID without reloading the page... and to be able to pass the values of the added records when I save the page.

That´s the problem :/
Not the looks of the grid.

/Smash

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 03-31-2003 18:36

Well, adding records requires using the DOM to manipulate the table dynamically (by creating rows and inserting them into the TBODY).

However, *saving* these records on the server so that they remain when the page is refreshed will require some sort of "Save" button or something, along with some server code. You would also have to do something like generate <input> feilds with type="hidden" with the DOM in order to send the data to the server.

I recently made an article about how to use the DOM for things like this, check out http://www.slimeland.com/content/articles/jsenhance/ , it might help a little bit.

SmashHallon
Nervous Wreck (II) Inmate

From: Sweden
Insane since: Mar 2003

posted posted 04-01-2003 11:18

Ok, thx for your time Slime. Is there any other way of doing it, without using the DOM?

Some kind of simple way that doesn't require so much time


Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 04-01-2003 16:17

Heh, well, you could use innerHTML, which is more intuitive, but that can get slow, and it'll still require scripting =)

« BackwardsOnwards »

Show Forum Drop Down Menu