Em geral, o ícone TreeGrid é o formulário de pasta e arquivo padrão, conforme mostrado na figura abaixo:
Podemos adicionar iconCls ao texto JSON para alterar o ícone padrão, por exemplo:
{"Total": 7, "linhas": [{"id": 1, "nome": "tudo Tarefas "," BEGIN ":" 3/4/2010 "," END ":" 20/3/2010 "," Progresso ": 60," ICONCLS ":" icon-ok "}, {" id ": 2," nome ":" design "," BEGIN ":" 3/4/2010 "," END ":" 3/10/2010 "," Progress ": 100," _ Parentid ": 1," State ":" Fecht "}, {" Id ": 21," Nome ":" Da Tabase "," Pessoas ": 2," Begin ":" 3/4/2010 "," End ":" 3/6/2010 "," Progress ": 100," _ Parentid ": 2}, {" Id ": 22," Nome ":" U. ML "," Pessoas ": 1," BEGIN ":" 7/2/2010 "," END ":" 3/8/2010 "," Progress ": 100," _ Parentid ": 2}, {" Id ": 23," Nome ":" Exportar Documento "," Pessoas ": 1," BEGIN ":" 9/3/2010 "," END ":" 3/10/2010 "," Progress ": 100," _ Parentid ": 2}, {" id ": 3," nome ":" codificação "," pessoas ": 2," BEGN ":" 3/11/2010 ":" " end ":" 18/03/2010 "," Progresso ": 80}, {" id ": 4," nome ":" teste "," pessoas ": 1," BEGIN ":" 3/19/2010 "," end ":" 3/20/2010 "," Progress ": 20}]," Foother ": [{" Nome ":" Pessoas: "," Pessoas ": 7," iconCls ":" icon-sum "}]}Em seguida, modifique o icon.css e coloque o ícone a ser usado na pasta especificada.
Geralmente, se você falar sobre essas modificações, o TreeGrid pode exibir os ícones que você projetou por si mesmo.
Se o ícone definido não puder ser exibido neste momento, você poderá verificar o pedido em que icon.css e easyui.css serão introduzidos na página. Certifique -se de que o easyui.css esteja na frente e o icon.css está na parte de trás. Caso contrário, o estilo em easyui.css substituirá o ponto icon.css e o ícone padrão ainda será exibido.
Abaixo, apresentarei o JQuery Easyui TreeGrid para adicionar, excluir, modificar e verificar o código
<script type = "text/javascript"> function formatProgress (value) {if (value) {var s = '<div>' + '<div>' + value + '%' + '</div>' '</div>'; return s;} else {return; indefinido) {$ ('#tg'). TreeGrid ('select', editingId); return;} var row = $ ('#tg'). TreeGrid ('getSelected'); if (linha) {editingId = Row.id $ ('#TG'). editingId); $ ('#tg'). TreeGrid ('Reloadfooter');} $ (". ActionBtn"). TogGleClass ("l-btn-Disabled");} função edit () {if (editingId! = Undefined) {$ ('#tg'). $ ('#tg'). TreeGrid ('getSelected'); if (line) {editingId = row.id $ ('#tg'). TreeGrid ('Bedinedit', editingId);} $ (". Actionbtn"). TogGleClass ("l-btn-disabled");} função insert (). indefinido) {$ ('#tg'). TreeGrid ('select', editingId); retornar;}/**/var lobs = $ ('#tg'). TreeGrid ('getChildren'); editingId = linhas.length+1; var row = null; var _data = {"idithId:" Editing, "" Nome "," Pessoas ": 0," BEGIN ":" 19/03/2010 "," End ":" 20/03/2010 "," Progress ": 10}; var _parentId = 0; var row = $ ('#tg'). TreeGrid ('getSelected'); se (linha) {$ ('#tg'). row.id;} else {var root = $ ('#tg'). TreeGrid ('getRoot'); _ parentid = null;} $ ('#tg'). TreeGrid ('Append', {Parent: _parentId, // aqui você pode especificar os dados do identificador pai: [_data]}); $ ('#tg'). TreeGrid ('Bedinedit', _ data.id); $ (". Actionbtn"). TogGleClass ("l-btn-disabled");} função ';) {if (editingId! = indefinido; var persons = 0; var lobas = t.TreeGrid ('getChildren'); para (var i = 0; i <robes.length; i ++) {var p = parseInt (linhas [i] .PerSons); if (! Isnan (p)) {PersOns+= p;}} var a t.TreeGrid ('getFooterrows') [0]; Frow.Persons = Persons; T.Treegrid ('Reloadfooter'); $ (". ActionBtn"). TogGleClass ("L-Btn-Disabled");}} função () {if (editingId! editingId);editingId = undefined;}$(".actionbtn").toggleClass("l-btn-disabled");}</script><div style="margin:10px 0;"><a href="javascript:void(0)" disabled="disabled" onclick="save()">Save</a><a href = "javascript: void (0)" desabilitado = "desativado" onclick = "cancel ()"> cancel </a> </div>