2012-12-27 3 views
0

URL을 전달할 때 URL에서 응답이 없으면 내 프로젝트에 포함 된 해당 WCF 서비스 페이지를 지정하면 URL에서 응답이 없습니다. 크로스 도메인 가능한 문제가 무엇이겠습니까URL 필드가 flexigrid와 작동하지 않습니다.

<form id="sform" runat="server"> 
    <table id="flex2" style="display:none"></table> 
    <script type="text/javascript"> 
     $(document).ready(function() { 
      var user_id = 1; 
      var data = { UserID: user_id }; 

     $("#flex2").flexigrid({ 

      useInlineEditor: true, 
      //singleSelect: true, 
      rowClick: function (row) { 
       //var r=this.DataSource.rows[row.rowIndex]; 
       //var p=$(row).offset(); 
       //alert(r[this.DataSource.key]+" "+r.Name+" offset:"+p.top+","+p.left); 
       //this.grid.inlineEditor.edit(row); 
      }, 

      url: 'http://192.168.10.91:5001/Service.svc/GetStates', 
      method: 'POST', 
      dataType: 'json', 
      colModel: [ 
      { display: 'Hours', name: 'hours', width: 40, sortable: true, align: 'center' }, 
      { display: 'DOC', name: 'doc', width: 180, sortable: true, align: 'left' }, 
      ], 
      searchitems: [ 
      { display: 'Type', name: 'cmetype' } 
      ], 
      onError: function (jqXHR, textStatus, errorThrown) { 
       alert("flexigrid failed " + errorThrown + jqXHR + textStatus); 
      }, 
      sortname: "type", 
      sortorder: "asc", 
      usepager: true, 
      title: 'States', 
      useRp: true, 
      rp: 15, 
      showTableToggleBtn: true, 
      width: 800, 
      height: 200 
     }); 
    }); 

    //This function adds paramaters to the post of flexigrid. You can add a verification as well by return to false if you don't want flexigrid to submit   
    function addFormData() { 
     //passing a form object to serializeArray will get the valid data from all the objects, but, if the you pass a non-form object, you have to specify the input elements that the data will come from 
     var dt = $('#sform').serializeArray(); 
     $("#flex2").flexOptions({ params: dt }); 
     return true; 
    } 

    $('#sform').submit(function() { 
     $('#flex2').flexOptions({ newp: 1 }).flexReload(); 
     return false; 
    }); 
</script> 
</form> 

답변

0

svc 서비스가 액세스 가능하고 게시물 요청을 수락 할 수 있는지 확인하십시오. 모두 제대로 작동하는 경우 응답이 JSON이고 유효한지 확인하십시오.

관련 문제