Sigma Php Ajax framework, Ajax Components, GUI Builder
May 17, 2012, 12:06:14 AM *
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: Create and render grid in an onClickCell-function of another grid  (Read 1661 times)
christian
Full Member
***
Posts: 31


View Profile
« on: January 23, 2009, 02:30:21 AM »

Is it possible to create and render grid in an onClickCell-function of another grid like this?



When I do this, I always geht the script error: 'separateLine.style' is null or no object 

But if I do something like this



outside the gridOptions definition, everything ist ok. But then, I have no more influence on the select boxes of the cell editor.  Huh

Any ideas? Thank you!
Logged
humi
Hero Member
*****
Posts: 284


View Profile
« Reply #1 on: January 24, 2009, 06:31:45 PM »

Not sure why you are doing this.

If you are trying to dynamically set values in a select list, this this is a weird way of doing it.
You could use the master/slave feature to do something like this also.

I think proper way of doing what you have below is:

Logged
christian
Full Member
***
Posts: 31


View Profile
« Reply #2 on: January 26, 2009, 01:28:40 AM »

Thank you very much for your answer! Hmm, I have two questions to your answer.

1. What is the difference between

and

? Sorry, if it is a beginner question. I took just the master/details example, and there it is like I did.

2. Master/Slave: Do you mean the Master/Details Example or something else? And yes, I want to do it with a master slave, but how?

I made the experience, that I can't influence the editor selectbox options after the grid is created. So it was my idea to create the second grid not till I have the value of my first grid, where the user clicked into a cell. Because the options of my second grid depending on the user input of the first grid.

Thank you!
« Last Edit: January 26, 2009, 01:30:31 AM by christian » Logged
humi
Hero Member
*****
Posts: 284


View Profile
« Reply #3 on: January 26, 2009, 05:00:44 AM »

To answer your questions:
1.) Not sure the specifics. But the second code you posted shows "when the onload function is called, do a function"
Its much like onCellClick: function(){}
I had played with these a lot because of problems having multiple grids on a tabbed page, and showing / hiding one at a time. I found the code that I gave you worked.

2.) What I mean is the Master / Slave example. I can write some better code if needed. But from my head somthing like:


Logged
christian
Full Member
***
Posts: 31


View Profile
« Reply #4 on: January 26, 2009, 08:35:29 AM »

Thank you for your answer!

I think, I have now a proper solution. Not very well, but it works.


« Last Edit: January 26, 2009, 08:41:45 AM by christian » Logged
humi
Hero Member
*****
Posts: 284


View Profile
« Reply #5 on: January 26, 2009, 09:10:35 AM »

Nice solution.

I had suggested a feature that will allow editors to be dynamically created (instead of staticly-rendered when mygrid.render() is called,) and it would make this issue not a problem. It will hopefully be in a future release.
Logged
christian
Full Member
***
Posts: 31


View Profile
« Reply #6 on: January 28, 2009, 12:23:58 AM »

Yes that would be helpfull. Till then, I can work with this solution. Thank you for your efforts!
Logged
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!