PDA

View Full Version : Showing detailed page on link



simondavies
21 Oct 2011, 8:06 AM
I have a list / nested list thats does what it does, but is it possibel to link to a dynamically created detaield page from another link, as at the moment I can link to my list but woudl be nice to hard link to its detailed page and give it an id to the json conent I want,


My List
newsstories -
Detaied Page
Selected story


my link on another section woudl link to the news list like

index.html/#app/newslist

But I woudl like to have this link to a particular list content

index.html/#app/newslist/1

the '1' being the json array vaule etc

Hope this makes sense.
Thanks

myput
24 Oct 2011, 12:08 AM
Hello, i think, you can use extraParams and a php file for give you a new Json file detailView.
I explain:

You have your last nestedList item, when you tap, you open a new view, then, you will open a DataView, (or list if you want) but you send an id to your detailView:
In your detailcard:
You must have an idCategorie for each item of your nestedlistlist


getDetailCard: function(item, parent) {
var itemData = item.attributes.record.data;
parentData = parent.attributes.record.data;
var DetailPanel = new Ext.Panel({
recordNode: item,
items: [app.views.ViewContainer],
});
DetailPanel.update(itemData);
Ext.getStore(app.stores.ViewContainerStore).setId(itemData.idCategorie);
return DetailPanel;
},


After in the ViewContainer:


app.stores.ViewContainerStore = new Ext.data.Store({
model : 'model',
proxy: {
type: 'ajax',
url: 'getContent.php',
reader: {
type: 'json',
}
},
setId: function (id) {
this.itemId = id;
app.stores.ViewContainerStore.load({params:{id:this.itemId}});
},
autoLoad: true
});


With extraParams, you will get the param in the PHP file, with $_GET[param]
Then, you can do a php script, where you decide to send to the new store, only data with 'param' parameter and Json_encode this array, and echo the Json string to the store.

It's the only way i found for the moment ...

Good luck
Hope this helps

simondavies
25 Oct 2011, 12:48 PM
thanks for this, I am currently on holiday so will not be able to experiment with this till next week, but will post back once I have.

Thanks