0

ストアを含むグリッドがあります。ストアに変数を渡すため。Cookie を使用しましたが、グリッドの 1 つのデータをクリックするたびに。Cookie の値は最初にクリックされた値に等しいため、最初に設定した後は変更されません。

そこにグリッドサイド:データがクリックされたときにCookieを設定しようとします(setcookieを使用して)。私はdeleteCookieを試みた後、rec_dosyaをグローバル値として宣言しましたが、機能しません.どうすれば解決できますか

var fileGrid_yp_is = new Ext.grid.GridPanel({
           contextMenu: new Ext.menu.Menu({
           items: [
            {
             id: 'Kullanici_yetki_id',
             text: 'Izin verilen Kullanici Listelesi',
             iconCls:'icon-grid-del',            
             listeners : {

                click : function(){
                    rec_dosya   = fileGrid_yp_is.getSelectionModel().getSelected();
                    rec_dosya=rec_dosya.data.id;
                    alert(rec_dosya);
                    deleteCookie('icerik_id');
                    setCookie('icerik_id',rec_dosya,365);
                //  alert(rec_dosya);

                //usersListWin.extraP = { a:11231231, b: 1, c: 2}; // Add additional stuff
          user_store.reload();
          usersListWin.show();



                }

            }
        },
        ]
    }),
    listeners: {
        celldblclick : function(gridim,rIndex,cIndex,e) {
            rec_dosya   = fileGrid_yp_is.getSelectionModel().getSelected();
             deleteCookie('icerik_id');
                    setCookie('icerik_id',rec_dosya,365);
             this.contextMenu.showAt(e.getXY());
        }
    },

    store: fileStore_yp_is,
    sm: new Ext.grid.RowSelectionModel({
        singleSelect:true
    }),
    trackMouseOver: true,
    frame:false,
    width:'auto',
    height:'auto',
    autoScroll : true,
    tbar:tbarim
});

店舗側では、

baseparams(icerik_id) で getcookie を使用してデータを取得しようとしています

var user_store = new Ext.data.JsonStore({
    root: 'rows',
    autoLoad: true,
    model: 'users',
    totalProperty: 'results',
    remoteSort: true,
    proxy: new Ext.data.HttpProxy({
       url: 'phps/kullanici_islemleri.php',
       method:'POST'

    }),
    baseParams:{
          action:'yetki',
          icerik_id:getCookie('icerik_id')
    },
    fields: [{
            name :'id'
        },{
            name :'icerik_id'
        },{
            name:'username'
        },{
            name:'rol'
        },{
            name:'gorme'
        },{
            name:'olusturma'
        },{
            name:'silme'
        }
    ]
});
4

1 に答える 1

1

Cookieプロバイダーで状態マネージャーを使用する

于 2012-11-17T23:56:14.313 に答える