jqgrid를 채우는 데 사용하는 json 문자열이 있습니다. 문자열에서 나는 하나의 요소가 하이퍼 링크입니다. 문제는 내가이 문자열을 사용하면 그리드가 전혀로드되지 않는다는 것입니다. 여기에 내 코드가jsonstring 데이터를 사용하여 JQGrid에 하이퍼 링크 넣기
var json = '{"total": "","page": "1","records": "","rows" : [{"id" :"1", "cell" :["<a href="http://www.google.com">Quantum of Solace</a>","142456", "1234.89", "1234"]},{"id" :"2", "cell":["01/04/2013", "7741", "007997.66", "234"]},{"id" :"3", "cell":["06/08/2013", "78976", "2329.336", "234"]},{"id" :"4", "cell":["01/01/2012", "6678", "2154.22", "1234"]},]}';
jQuery(document).ready(function() {
jQuery("#list").jqGrid({
datatype: 'jsonstring',
datastr:json,
colNames: ['Date', 'Account ', 'Amount', 'Code'],
colModel: [
{ name: 'adate', index: 'adate', width: 90, sorttype: 'date', datefmt: 'Y-m-d' },
{ name: 'account', index: 'account', width: 80, align: 'right', sorttype: 'int' },
{ name: 'amount', index: 'amount', width: 80, align: 'right', sorttype: 'float' },
{ name: 'code', index: 'code', width: 80, align: 'right', sorttype: 'int' }
],
pager: "#pager",
toppager: true,
rowNum: 10,
rowList: [10, 20, 30],
toolbar: [true, "top"],
sortorder: "desc",
viewrecords: true,
gridview: true,
imgpath: 'F:/profile/ProgramFiles/JQGrid/jquery-ui-1.10.3.custom/development-bundle/themes/redmond/images',
autoencode: true,
height: '100%',
caption: "My first grid"
}).navGrid('#pager', { edit: true, add: true, del: true, search: true, refresh: true, cloneToTop: true });
});
colModel을 변경해야합니까? 그리드가로드되지 않는 이유는 무엇입니까? 링크를 임의의 텍스트로 바꾸면 격자가 제대로 작동합니다.
도와주세요, 난 정말 그리드의 하이퍼 링크를 구현해야하고 난 imgpath: 'F:/profile/...'
옵션을 모두 사용 예를 myName: 'user2334092'
에 대한의 사용과 같은 동일한 효과를의 백엔드
감사를 표시! – AbtPst
@ user2334092 : 안녕하세요. 문제가 해결되면 답변을 받아야합니다 (http://meta.stackexchange.com/a/5235/147495). – Oleg