array(556) { ["A1"]=> string(9) "Timestamp" ["B1"]=> string(17) "Untitled Question" ["C1"]=> string(17) "Sample Question 1" ["D4"]=> string(23) "Project Scheduling 2010" ["AJ4"]=> string(4) "2011" ["D5"]=> string(13) "Send Feedback" ["J5"]=> string(4) "JUNE" ["N5"]=> string(3) "JUL"
^ - etc..is the array I'm receiving after successfully connecting to my google spreadsheet and getting a feed for 'all cells'. The problem is that I'm a novice and don't know how to take this array as a data source to convert it into something manageable like gridview/some html table equivalent.
What should I do with this array if I basically want to just read it with javascript/css to create a clone that I can work with [by that I mean it looks like a spreadsheet, in the future with some adjustments I'll be able to edit functionality - clicking a cell will open an accordian modal with information from another page etc etc...stuff Google Spreadsheets won't let me code into its interface - I want control here].
If my question is too vague/verbose I'll try to reword it.
class My_View_Helper_GDataTable extends Zend_View_Helper_Abstract
{
public function gDataTable($data)
{
$firstLetter = intval('A');
$numCols = $this->_getNumCols($data);
$res = '<table>';
for ($j = 1; $j <= $numRows; $j++) {
$res .= '<tr>';
for ($i = $firstLEtter; $i <= $firstLetter+$numCols; $i++) {
$res .= '<td>' . $data[$i.$j] . '</td>';
}
$res .= '</tr>';
}
$res .= '</table>';
return $res;
}
protected function _getNumCols($data)
{
/*
to be implemented
not sure how exactly can you do it
zend gdata should offer some method for this
*/
}
}
Then in view:
//somewhere in view init
$view->addHelperPath('some/path', 'My_View_Helper');
//in your view
$this->gDataTable($dataFromZendGdata);