2010-04-20 8 views
1

안녕하세요, Extjs를 사용하고 있습니다. 편집 가능한 셀이있는 표를 만들었습니다. 이 셀 중 하나는 json 데이터를 생성하는 스크립트에서 옵션을 취하는 콤보 박스 여야합니다. 그리드 및 콤보 셀 편집기에 대한 코드가 작동하지만 나는 스크립트에 대한 json 요청이 처음으로 캐시 된 후 가능합니까? 내가 코드를 작성Extjs JSON 요청 캐시

, 이것은 내가 그리드 생성자에서 콤보 상자 열 선언하는 부분이다 :

{ 
    dataIndex:"authors_name", 
    id:"authors_name", 
    header:"Authors", 
    editable:true, 
    sortable:true, 
    editor:{ 
     xtype:"combo", 
     allowBlank:false, 
     editable:false, 
     forceSelection: true, 
     displayField: 'authors_name', 
     valueField: 'authors_id', 
     store:new Ext.data.JsonStore({ 
      proxy:new Ext.data.HttpProxy({ 
       //This is the json request to cache 
       url: 'index.php?load=authors' 
      }), 
      root: 'items', 
      fields: ['authors_name','authors_id'] 
     }) 
    } 
} 

답변

2

내가 내선 포럼에 게시하여 답을 찾았을이 누군가 경우 솔루션입니다 관심있는 사용자 :

{ 
    dataIndex:"authors_name", 
    id:"authors_name", 
    header:"Authors", 
    editable:true, 
    sortable:true, 
    editor:{ 
     xtype:"combo", 
     allowBlank:false, 
     editable:false, 
     forceSelection: true, 
     displayField: 'authors_name', 
     valueField: 'authors_id', 
     //Add mode and triggerAction properties to make it work locally 
     mode:"local", 
     triggerAction:"all", 
     store:new Ext.data.JsonStore({ 
      proxy:new Ext.data.HttpProxy({ 
       url: 'index.php?load=categories&request=data&type=getAuthors' 
      }), 
      //Use the autoload property to do the request only one time 
      autoLoad:true, 
      root: 'items', 
      fields: ['authors_name','authors_id'] 
     }) 
    } 
}