SQL 데이터 바인딩 및 largejsonresult와 함께 작동하도록 jqxGrid를 가져 오는 데 문제가 있습니다. 여기에 현재 코드가 있습니다.jqxGrid with SQL Binding 및 LargeJsonResult가 비어 있습니다.
컨트롤러 :
public LargeJsonResult GetCustomers()
{
var dbResult = db.CPTs.ToList();
var customers = from customer in dbResult
select new
{
customer.CPT1,
customer.MOD,
customer.SDESC,
customer.FAGE,
customer.TAGE
};
return new LargeJsonResult { Data = customers, JsonRequestBehavior = System.Web.Mvc.JsonRequestBehavior.AllowGet };
}
보기 : 내가 직접 dbCPT/GetCustomers를 실행하면
<script type="text/javascript">
$(document).ready(function() {
// prepare the data
var source = {
datatype: "json",
datafields: [{ name: 'CPT1' }, { name: 'MOD' },
{ name: 'SDESC' }, { name: 'FAGE' }, { name: 'TAGE' }, ],
url: 'dbCPT/GetCustomers'
};
$("#jqxgrid").jqxGrid({
source: source,
theme: 'classic',
columns: [{ text: 'Company Name', datafield: 'CompanyName',
width: 250
}, { text: 'CPT Code', datafield: 'CPT1', width: 150 },
{ text: 'Short Description', datafield: 'SDESC', width: 180 },
{ text: 'FAGE', datafield: 'From Age', width: 200 },
{ text: 'TAGE', datafield: 'To Age', width: 120}]
});
});
</script>
<h2>Index</h2>
<div id="jqxgrid"></div>
나는 당기는거야하지만 아무것도 그리드 때 표시되지 않습니다 모든 데이터를 출력 파일을 얻을 dbCPT 페이지로 이동합니다.
내 코드가 더 필요하면 알려 주시기 바랍니다.
감사합니다.
jqxGrid의 [jqwidgets] (http://www.jqwidgets.com/) 및 jqGrid는 ** 다른 ** 제품입니다. 그래서 귀하의 질문에 잘못된 태그를 사용했습니다. – Oleg
qjxgrid 및 qjwidgets는 새로운 태그로 간주되었으므로 사이트를 처음 사용하기 때문에이를 사용하지 않을 것입니다. 제 사과, jqgrid가 가장 가까운 곳이었습니다. –