PDA

View Full Version : Problem with GET-Param. (HttpProxy)



marvman
10 Dec 2007, 12:17 PM
Hey,

my problem is that i can not send the get paramter i want...

here my code



var store_ActionItems = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'feed-proxy.php?feed='+Ext.getCmp('qvideo').getValue()
}),

reader: new Ext.data.XmlReader(
{record: 'entry'},
['title', 'hits', 'rating', 'vduration', 'content', 'vlink']
),

autoLoad: true
})



url: 'feed-proxy.php?feed=test' <-- this works fine.


what is the problem, by using "Ext.getCmp('qvideo').getValue()" to add the var i want?

tryanDLS
10 Dec 2007, 1:03 PM
Set a BP in Firebug there. Is the getValue call returning a value?

marvman
11 Dec 2007, 9:53 AM
the problem is, i can not test it. because, there must be an error...when i

have this code



store_ActionItems = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'feed-proxy.php?feed='+Ext.getCmp('qvideo').getValue()
}),

reader: new Ext.data.XmlReader(
{record: 'entry'},
['title', 'hits', 'rating', 'vduration', 'content', 'vlink']
),

autoLoad: true
})


nothing is shown up on the page...so there must be a syntax error

tryanDLS
11 Dec 2007, 10:27 AM
Did you use jslint to check for a syntax error? Make sure Firebug is set to break on all errors.

marvman
11 Dec 2007, 10:36 AM
Error:

Implied global: Ext 1 2 3 6, store_ActionItems 1


and here a paste from the breakpoint



Ext.getCmp("qvideo") has no properties
(no name)()mainDesign.js (line 7)
Observable()ext-all.js (line 12)
EventManager()


that tells me???

damien
11 Dec 2007, 11:18 AM
You can try this one, i don't now if it helps. Give it a try.


Ext.getCmp('qvideo').value

marvman
11 Dec 2007, 11:43 AM
nope..does not work.


my idea is to put it in a function



function store_ActionItems(title)
{
new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'feed-proxy.php?feed='
}),

reader: new Ext.data.XmlReader(
{record: 'entry'},
['title', 'hits', 'rating', 'vduration', 'content', 'vlink']
),

autoLoad: true
})
};


but then the call does not work anymore



var ActionItemGrid = new Ext.grid.GridPanel({
store:store_ActionItems,

damien
11 Dec 2007, 11:51 AM
1. You use "qvideo", do you have a component with id:"qvideo"
and is it rendered before you try to do the getValue()?
2. Use the baseParams option to send parameters with the request
http://extjs.com/deploy/dev/docs/?class=Ext.data.Store (http://extjs.com/forum/../deploy/dev/docs/?class=Ext.data.Store)

marvman
11 Dec 2007, 12:23 PM
yes i have qvideo, and it works fine in other lines.

i have a button, with handle...



region:'west',
id:'west-panel',
title:'West',
split:true,
style:'text-align:center',
width: 200,
minSize: 175,
maxSize: 400,
collapsible: true,
margins:'0 0 0 5',
layout:'accordion',
layoutConfig:{
animate:true
},
items: [{
contentEl: 'west',
title:'Navigation',
border:false,
iconCls:'nav',
items:[{
xtype:"textfield",
fieldLabel:"Text",
name:"qvideo",
id:"qvideo",
style:'margin-top:10px;'
},
new Ext.Button({
region:'west',
style:'margin-top:10px;',
handler: function(){
addTab(Ext.getCmp('qvideo').getValue())},
text: 'Search',
iconCls:'new-tab'
})
]
},{




var newPanel = Ext.getCmp('centertab').add(new Ext.Panel({
title: title || ' Unknown' ,
closable:true,
autoScroll:true,
items:[ActionItemGrid],
layout: 'fit'
}));
Ext.getCmp('centertab').setActiveTab(newPanel);
};



works fine =/ thats y i'm wondering why it is not working in the other part.

hendricd
11 Dec 2007, 2:51 PM
At the stage you are defining your store, it's likely that the field has not been rendered yet.

You should be using the store's 'beforeload' event to set runtime parameters.

IOW: Your timing is all off.

marvman
12 Dec 2007, 1:38 PM
mh okey...but

is there a chance to put this



store_ActionItems = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'feed-proxy.php?feed=' + Ext.getCmp('qvideo').getValue()
}),

reader: new Ext.data.XmlReader(
{record: 'entry'},
['title', 'hits', 'rating', 'vduration', 'content', 'vlink']
),

autoLoad: true
})


in a function? and then call it in the store event here?



var ActionItemGrid = new Ext.grid.GridPanel({
store:store_ActionItems,
columns: [{
header: "Title",
dataIndex: 'title',
width: 420,
sortable:false
},{
header: "Add",
dataIndex: 'vlink',
qtip: "Add to playlist",
width: 32,
sortable:false,
renderer: this.formatAdd
},{
header: "Hits",
dataIndex: 'hits',
width: 100,
sortable:false
},{
header: "Rate",
dataIndex: 'rating',
width: 100,
sortable:false
},{
header: "Dauer",
dataIndex: 'vduration',
width: 100,
sortable:false
}],
viewConfig: {
forceFit: true
},
sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
autoExpandColumn:"Action Item",
stripeRows: true,
autoScroll: true,
autoWidth: true,
autoHeight: true,
border:false,
frame:false,
autoload: true,
iconCls:'icon-grid',
id:'topic-grid'

});


because then i could submit the value easy...