New DataSource in DataGrid

thread: 2 messages  |  last: a year ago  |  started: wednesday, february 1, 2012, 5:04 pm pst


#1  |  Krammitman (Salt Lake City, CA) United States of America
Wednesday, February 1, 2012, 5:04 PM PST

I'm a total noob to Qcodo, I'm just looking for a simple solution to an easy problem. I have 2 separate arrays I would like to add to 2 separate columns in my DataGrid. Is there a way to change the DataSource of the grid after creating a column and then using the new data source to print a second column?

I don't have a problem creating a column using the first array but when I try to change the DataSource to the second array it just overwrites everything in the first column.

I've tried doing it as a 2 Dim array but can't get it to call a specific array inside my 2D array, instead it only uses the information from both arrays from the specified index.(I.E Array ( [0] => Array ( [0] => stuff [1] => Other [2] => last ) [0] => Array ( [0] => 2 [1] => 1 [2] => 1 ) ) When I specify Index 0 i presumed it would give me the array from index 0 and print the three indexes from that array, instead it gives me Stuff, and 2 the index 0 for both arrays inside the parent array. moreover it only creates a column with 2 rows despite me having multiple indices I presume that has to do with my DataSource only having to $_ITEM's inside it.

I apologize for the uber noob question but could really use some help.

#2  |  Krammitman (Salt Lake City, CA) United States of America
Wednesday, February 1, 2012, 10:56 PM PST

Never Mind. I did what I needed too I just used 2 separate DataGrid Objects and changed the template file So they were displayed on the same HTML table. Still if there is a way to specify a new DataSource for a new column I would like to know.



Copyright © 2005 - 2013, Quasidea Development, LLC
This open-source framework for PHP is released under the terms of The MIT License.