Welcome Guest, Not a member yet? Register   Sign In
Design help about integrating a javascript library/helper
#1

[eluser]liri[/eluser]
Hey guys,

Some background
'Been playing a bit with ExtJS data grid.
For the proof of concept phase I have all the javascript code in the view and what I'd like is to create a helper for building the grid since it relies on some pieces of information such as:

1. remote url for data source (retrieved via ajax)
2. the column names passed from the remote data source (json or xml)
3. the column's friendly name for title


Design suggestion
To utilize code re-use and the rest of the OOD enchilada I want to put the wrap the use of the javascript inside a library/helper. So the class would be called from the controller with all the information it needs, build the javascript code and return it as a string which can then be passed to the view. Something like:
Code:
$getGridJs = $dataGridClass->getGrid();
$data['jsgrid'] = $getGridJs
$this->load->view('..', $data);


I'd appreciate to get your opinion for a better design of this.
For example, I'm not sure if that idea works well with caching or maybe it has other culprits
I didn't think of.


Thanks.


Messages In This Thread
Design help about integrating a javascript library/helper - by El Forum - 06-26-2010, 08:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB