2012-01-03 2 views
0

flexigrid에 대한 웹 서비스 호출에 매개 변수를 전달하려고합니다.FlexiGrid를 사용하여 웹 서비스 호출에 매개 변수를 전달하는 방법

내 웹 서비스 호출에 하나의 매개 변수를 전달하려고 시도 할 때를 제외하고 FlexiGrid를 올바르게 설정했지만 해당 매개 변수를 사용하여 모눈을로드하려고 할 때 500 내부 서버 오류가 표시됩니다.

이상적으로 사용자가 제출을 클릭하면 flexigrid에 대한 ajax 호출을 호출하는 javascript 함수를 호출하지만 방화 광에서 500 Internal Server Error를 볼 수 있습니다.

lastName 매개 변수가 웹 서비스 호출에서 누락되었다고합니다. 이 매개 변수는 성 검색 텍스트 상자에서 가져옵니다.

FlexiGrid의 초보자부터 도움을 받으실 수 있습니다. 대신이의

$("#userflexiGrid").flexigrid({ 
    url: 'FlexiGridService.asmx/GetDirectory', 
    params: [{ name: 'lastName', value: 'doe'}], 
    dataType: 'xml', 
    colModel: [ 
      { display: 'Id', name: 'Employeeno', width: 30, sortable: true, align: 'left' }, 
      { display: 'Name', name: 'Employee', width: 130, sortable: true, align: 'left' }, 
      { display: 'Bureau', name: 'Bureau', width: 180, sortable: true, align: 'left' } 
      ], 
    searchitems: [ 
      { display: 'Name', name: 'Employee' }, 
      { display: 'Bureau', name: 'Bureau' }, 
      ], 
    sortname: "Name", 
    sortorder: "asc", 
    usepager: true, 
    title: 'Flexi Users', 
    useRp: true, 
    rp: 20, 
    showTableToggleBtn: false, 
    pagestat: 'Displaying: {from} to {to} of {total} matches.', 
    //width: 700, 
    singleSelect: true, 
    onSubmit: addFormData, 
    height: 260 
}); 
+0

'의 PARAMS'작품을 같이하려고합니다. 여기를 참조하십시오 http://stackoverflow.com/a/7468213/588759 – rofrol

답변

0

:

$("#userflexiGrid").flexigrid({ 
    url: 'FlexiGridService.asmx/GetDirectory', 
    params: [{ name: 'lastName', value: 'doe'}], 
    dataType: 'xml', 

이 작업을 수행 :

$("#userflexiGrid").flexigrid({ 
    url: 'FlexiGridService.asmx/GetDirectory?lastName=doe', 
    dataType: 'xml', 

는 사실, PARAMS라는 같은 것은 없다

여기 내 아약스 호출입니다.

하면 문서 페이지에서 참조하시기 바랍니다 here

0

당신은이 같은 태그의 onsubmit 이벤트에 flexOptions를 사용할 수 있습니다

검색 텍스트 상자의 값은 (대신에 하드 코딩하여 얻을 수 있습니다
onSubmit: function() { 
$('#userflexiGrid').flexOptions(
{ 
    newp:1, 
    params:[{name: 'lastName', value: 'doe'}] 
}); 
} 

'doe') :

$ ('. qsbox'). val();

0

나를 위해이

jQuery('#userflexiGrid').flexOptions({        
          url: 'FlexiGridService.asmx/GetDirectory', 
          qtype: 'lastName', 
          query: 'doe'        
         }).flexReload(); 
관련 문제