2014-10-22 5 views
0

은 어제 아무런 문제없이 작동하는입니다. 그러나 나는 오늘 아침 워크 스테이션을 떠난 후 돌아온 이래로 코드에서 명백한 변화를 확인할 수 없습니다.dataSourceURL에서 igGrid "404를 찾을 수 없음"

JsonAction 개체를 반환하고 매개 변수 (HttpGet)를 받아들이지 않는 ASP.NET MVC 5 컨트롤러 메서드가 있습니다. 나는 그 반환을 테스트했고, 적절한 JSON을 리턴하고있다. 어제와 같은 구조이다. 내가이 문제를 갖지 않았을 때다. 이것은 서버 측에서 어떤 가능성도 배제하는 것처럼 보입니다.

데이터 바인딩에 대한 호출은 다음과 같습니다 URL을 사용하고 있습니다 :

/홈/GetAllUsersJSON PK = 사용자 ID & _ = 1413996086894 원인은의 조사에서 나타납니다

? Chrome에서 igGrid의 클라이언트 API가 dataBind() 중 dataSourceURL 끝에 쿼리 ​​문자열을 추가하거나 추가하려고 시도하는 것으로 보입니다. 필자는 관련 데이터베이스 테이블에서 두 번째 매개 변수 (이름도없고 겉보기에는 밑줄 문자 임)의 값을 식별 할 수도 없습니다 (즉, 그 값의 출처에 대한 단서가 없습니다). 그러나 각 디버그 시도를 통해 변경되지 않습니다.

저는 클라이언트 측 (JS) 만 사용하여 igGrid를 렌더링하고 조작합니다.

$(document).ready(function() { 
    $('#usersgrid').igGrid({ 
     autoGenerateColumns: false, 
     columns: [ 
      { headerText: 'userid', key: 'userid', dataType: 'number' }, 
      { headerText: 'username', key: 'username', dataType: 'string' }, 
      { headerText: 'login', key: 'loginid', dataType: 'string' }, 
      { headerText: 'role', key: 'role', dataType: 'string' }, 
      { headerText: 'distributor', key: 'distributorid', dataType: 'number' }, 
      { headerText: 'inactive', key: 'inactive', dataType: 'boolean' }, 
      { headerText: 'lastupdated', key: 'lastupdated', dataType: 'date', format: 'dateTime' } 
     ], 
     dataSourceUrl: '/Home/GetAllUsersJSON', 
     primaryKey: 'userid', 
     features: [{ 
      name: 'Updating', 
      enableAddRow: true, 
      enableDeleteRow: true, 
      columnSettings: [{ 
       columnKey: 'userid', 
       editorOptions: { readonly: true, disabled: true } 
      }, { 
       columnKey: 'username', 
       editorType: 'string', 
       validation: true, 
       editorOptions: { required: true } 
      }, { 
       columnKey: 'loginid', 
       editorOptions: { readonly: true, disabled: true } 
      }, { 
       columnKey: 'role', 
       editorType: 'string', 
       validation: true, 
       editorOptions: { required: true } 
      }, { 
       columnKey: 'distributorid', 
       editorType: 'numeric', 
       validation: true, 
       editorOptions: { button: 'spin', minValue: 0, maxValue: 2000000, required: true } 
      }, { 
       columnKey: 'inactive', 
       editorType: 'combo', 
       editorOptions: { 
        mode: 'dropdown', 
        required: true, 
        dataSource: trueFalseValues, 
        textKey: 'text', 
        valueKey: 'value' 
       } 
      }, { 
       columnKey: 'lastupdated', 
       editorOptions: { readonly: true, disabled: true } 
      }] 
     } ] 
    }).igGrid('dataBind'); 
}); 

답변

0

대신 dataSourceUrldataSource 옵션을 사용하여 여기에 코드입니다. dataSourceUrl은 MVC의로드 온 디맨드 시나리오 용이며 초기 데이터 바인딩에는 사용되지 않습니다. 원격 URL을 dataSource 옵션 값으로 전달할 수 있습니다. 표시되는 매개 변수는 기본 키 필드의 이름과 jsonp 요청이 완료 될 때 실행될 콜백입니다.

+0

http://stackoverflow.com/questions/28434621/using-my-custom-ajax-call-for-load-on-demand-on-ighierarchical-grid를 참조하십시오. –

관련 문제