Thank you that i going to use it later.
This is my case:
i enter to my web application with an url like this:
http://localhost/TCUVapp/index.html?var1=9&var2=873
index.html
Code:
<html>
<head>
<title>TCUV</title>
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" />
<script type="text/javascript" src="extjs/ext-debug.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body></body>
</html>
app.js in this file i obtain the variables from the url
Code:
Ext.application({
name: 'TCUV',
appFolder: 'app',
controllers: ['Recomendaciones'],
launch: function () {
var urlinicial = location.search.substring(1);
var var1 = Ext.Object.fromQueryString(urlinicial).var1;
Ext.create('Ext.container.Viewport', {
layout: {
type: 'border',
padding: 5
},
defaults: {
split: true
},
items: [{
region: 'west',
collapsible: true,
title: 'MenĂº',
split: true,
width: '15%'
}, {
region: 'center',
layout: 'border',
border: false,
items: [{
region: 'center',
items: [{
xtype: 'recomendacionlist'
}]
}]
}]
});
}
});
I need to past the var1 to my file with the store. I have this in
app/store/recomendaciones.js
Code:
Ext.define('TCUV.store.Recomendaciones', {
extend: 'Ext.data.Store',
model: 'TCUV.model.Recomendaciones',
autoLoad: true,
proxy: {
type: 'ajax',
api: {
read: 'http://localhost/WsTCUV/Service.asmx/GetRecomendaciones?var1=9&var2=873'
},
headers: {
'Accept': 'application/json, text/javascript, *=*',
'Content-Type': 'application/json; charset=utf-8'
},
reader: {
type: 'json',
root: 'd'
},
}
});
In my store i have the value of var1 and var2 with a static value but i need the value for var1 and var2 from the url of the beginning (http://localhost/TCUVapp/index.html?var1=9&var2=873).
Thanks for your help!.