2014-07-11 2 views
0

C# 프로젝트에서 공유 할 수있는 ext.js 저장소를 만들고 싶습니다. Services 프로젝트의 Scripts/Store/Hierarchies.js에 내 저장소를 정의했습니다. 이 저장소의 이름은 NCS.store.Hierarchies입니다. 나는 지금 내가 제대로이 저장소를 참조하려면 어떻게다른 C# 프로젝트의 ext.js 저장소 참조

Ext.widget({ 
      id: 'hierarchyPanel', 
      xtype: 'panel', 
      border: true, 
      frame: true, 
      title: 'Hierarchy Selector', 
      layout: { 
       type: 'hbox', 
       pack: 'start', 
       align: 'stretch' 
      }, 
      collapsible: true, 
      items: NCS.store.Hierarchies.getComboArray().concat(
      Ext.create('Ext.Button', { 
       id: 'hierarchyClear', 
       text: 'Clear' 
      })), 
      renderTo: this.constants.hierarchiesId, 
      listeners: { 
       show: { 
        fn: function (t, o) { 
         t.doLayout(); 
        } 
       } 
      } 
     }); 

를 저장 - 참조 할 다른 C# 프로젝트에서

Ext.define('NCS.store.Hierarchies', { 
requires: [ 
    'Ext.data.proxy.Proxy', 
    'Ext.data.Operation', 
    'Ext.data.reader.Json', 
    'NCS.store.SelectedHierarchies' 

], 

? 현재 나는 오류를 발견하지 못했습니다 (실제로 저장소를 포함하고있는 대신 현재 C# 프로젝트 URL을보고 있습니다).

> GET 
> http://localhost/Orchard/NCS.Reporting.PODS/NCS/store/Hierarchies.js?_dc=1405085182757 
> 404 (Not Found) 

나는 내 이름 지정 규칙을 일치하도록 폴더 레이아웃을 변경해야하는 경우 궁금 해요 NCS/저장에서 찾고 있기 때문에 또한

http://localhost/Orchard/NCS.Services.PODS/NCS/store/Hierarchies.js?_dc=1405085182757 

보고해야한다고 생각.

답변

0

당신은 ExtJS에 Loader 객체를 사용할 수 있습니다. 이제 NCS 경로가로드되었으므로 위의 코드를 사용하여 NCS.store.Hierarchies를 참조 할 수 있습니다.

0

웹 서버가 웹 요청에 응답하여 IIS를 제공 할 수 있도록 스크립트가 저장된 폴더를 IIS의 가상 디렉터리로 매핑하는 것이 좋습니다. ExtJS에 올바른 파일을 찾을 수 있도록

// load up all of our dependencies 
Ext.Loader.setConfig({ 
    enabled: true, 
    paths: { 
     'NCS': Config.RootUrl + 'Modules/NCS.Services.PODS/Scripts' 
    } 
}); 

내가 어디 NCS를 찾을 지정해야합니다 -

관련 문제