PDA

View Full Version : DataView from existing markup



dolittle
30 Dec 2009, 5:44 AM
Hi,

I have a page with a list of categories (divs with text).
The server side build the initial markup with all the categories.
The user can filter the list of a combobox.
When the filter is changed I'm loading the filtered list from the server.
A Dataview is perfect for this.

How can I tell the DataView to use the initial markup and to clean it on the first combobox change?

I know how to do it without the initial markup.

Thanks

Condor
30 Dec 2009, 5:57 AM
A DataView needs a store, so you should create a store that loads it's data using an XmlReader that reads the created HTML markup.

Next, you create the dataview with this store using a tpl that adds the markup again.

dolittle
30 Dec 2009, 6:15 AM
can I skip the first step of reading the created markup?

Will the DataView know to clear the div holding it is renderedTo?

Condor
30 Dec 2009, 6:21 AM
No, the dataview won't clear the div (unless you use applyTo instead of renderTo).