小编Dig*_*poo的帖子

Sencha Touch点击动态商店网址

我希望我在Sencha touch中的商店加载一个不同的PHP文件,具体取决于我点击旋转木马中的哪个项目.我的轮播中的每个项目都分配了itemid:{number}.这是我的商店:

var store = new Ext.data.Store({
        model: 'One',
        proxy: {
            type: 'ajax',
            url: '/carousel2store/Carousel 2_files/get-album.php',
            reader: {
                type: 'json',
                root: 'albums'
            }
        },....etc
Run Code Online (Sandbox Code Playgroud)

我已经尝试改变这样的商店,它给了'/ carousel2store/Carousel 2_files/get-album2.php',但是我想让数字2动态,所以它在点击时改变:

var store = new Ext.data.Store({
        model: 'One',
        proxy: {
            type: 'ajax',
            url: '/carousel2store/Carousel 2_files/get-album' + '2' +'.php',
            reader: {
                type: 'json',
                root: 'albums'
            }
        },
Run Code Online (Sandbox Code Playgroud)

我试图添加itemid

url: '/carousel2store/Carousel 2_files/get-album' + '{itemid}' +'.php', and
url: '/carousel2store/Carousel 2_files/get-album' + '{data.itemid}' +'.php',
Run Code Online (Sandbox Code Playgroud)

但到目前为止我没有运气.在sencha论坛上一个非常有用的人建议我试试这个:

var store = new Ext.data.Store({
        model: 'One',
        proxy: {
            type: 'ajax',
            url: '/carousel2store/Carousel …
Run Code Online (Sandbox Code Playgroud)

url store dynamic carousel sencha-touch

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

carousel ×1

dynamic ×1

sencha-touch ×1

store ×1

url ×1