Hi there,
I'm trying to create a detalis template on the mobile igListView with javascript and the only sample i found its done in HTML.
Can someone help me doing it with javascript?
Hello,
Thank you for contacting Infragistics!
I have done some looking into this matter and have the following information. First looking at your code I notice a few things. You are using “NUMOF” as your primarykey for the parent and child layout. However looking at your data “NUMOF” does not exist in the child data. Next in your data you are missing an open double quote on your second to last PEDIDO.
Concerning setting up a multi-level listView I recommend you see the following documentation as it goes over how you can achieve this in both html and JavaScript as well as MVC.
http://www.igniteui.com/help/iglistview-configuring-multi-level-data-binding
Please let me know if you have any further questions concerning this matter.
the Json its this one:
{"success":true,"results":6,"message":"Pedido executado
com sucesso.","exception":"","data":[
{"NUMOF":"00002039","DESC_ART":"Bodendeckel, gefräst"
,"DATA_ENTREGA":"23/02/2015 00:00:00","DETALHES":
{"COD_ART":"420-240.050-008","QUANT":"100,0000000",
"PEDIDO":"7200133221","ENC_PHC":"150","OBSERVACOES":""}},
{"NUMOF":"00001994","DESC_ART":"Bodendeckel, gefräst",
"DATA_ENTREGA":"16/02/2015 00:00:00","DETALHES":
"PEDIDO":"7200133038","ENC_PHC":"132","OBSERVACOES":""}},
{"NUMOF":"00001991","DESC_ART":"Bodendeckel, gefräst",
"DATA_ENTREGA":"09/02/2015 00:00:00","DETALHES":
{"COD_ART":"420-240.050-008","QUANT":"40,0000000",
"PEDIDO":"7200133007","ENC_PHC":"130","OBSERVACOES":""}}
,{"NUMOF":"00001765","DESC_ART":"Bodendeckel, gefräst",
"DATA_ENTREGA":"06/02/2015 00:00:00","DETALHES":
{"COD_ART":"420-240.050-008","QUANT":"720,0000000",
"PEDIDO":"7200132241","ENC_PHC":"12","OBSERVACOES":""}}
,{"NUMOF":"00001581","DESC_ART":"Bodendeckel, graviert",
"DATA_ENTREGA":"14/01/2015 00:00:00","DETALHES":
{"COD_ART":"420-086.042-005","QUANT":"200,0000000",
PEDIDO":"7200131211","ENC_PHC":"821","OBSERVACOES":""}
},{"NUMOF":"00001407","DESC_ART":"Bodendeckel, graviert",
"DATA_ENTREGA":"02/12/2014 00:00:00","DETALHES":
{"COD_ART":"420-086.042-005","QUANT":"91,0000000",
"PEDIDO":"7200129797","ENC_PHC":"700","OBSERVACOES":""}}]}
And the Json im using is this one:
{"success":true,"results":6,"message":"Pedido executado com sucesso.","exception":"","data":[{"NUMOF":"00002039","DESC_ART":"Bodendeckel, gefräst","DATA_ENTREGA":"23/02/2015 00:00:00","DETALHES":{"COD_ART":"420-240.050-008","QUANT":"100,0000000","PEDIDO":"7200133221","ENC_PHC":"150","OBSERVACOES":""}},{"NUMOF":"00001994","DESC_ART":"Bodendeckel, gefräst","DATA_ENTREGA":"16/02/2015 00:00:00","DETALHES":{"COD_ART":"420-240.050-008","QUANT":"100,0000000","PEDIDO":"7200133038","ENC_PHC":"132","OBSERVACOES":""}},{"NUMOF":"00001991","DESC_ART":"Bodendeckel, gefräst","DATA_ENTREGA":"09/02/2015 00:00:00","DETALHES":{"COD_ART":"420-240.050-008","QUANT":"40,0000000","PEDIDO":"7200133007","ENC_PHC":"130","OBSERVACOES":""}},{"NUMOF":"00001765","DESC_ART":"Bodendeckel, gefräst","DATA_ENTREGA":"06/02/2015 00:00:00","DETALHES":{"COD_ART":"420-240.050-008","QUANT":"720,0000000","PEDIDO":"7200132241","ENC_PHC":"12","OBSERVACOES":""}},{"NUMOF":"00001581","DESC_ART":"Bodendeckel, graviert","DATA_ENTREGA":"14/01/2015 00:00:00","DETALHES":{"COD_ART":"420-086.042-005","QUANT":"200,0000000","PEDIDO":"7200131211","ENC_PHC":"821","OBSERVACOES":""}},{"NUMOF":"00001407","DESC_ART":"Bodendeckel, graviert","DATA_ENTREGA":"02/12/2014 00:00:00","DETALHES":{"COD_ART":"420-086.042-005","QUANT":"91,0000000","PEDIDO":"7200129797","ENC_PHC":"700","OBSERVACOES":""}}]}
I'm doing it like this:
$("#basicJsonListView").igListView({ dataSourceUrl: url, responseDataKey: "data", bindings: { detailsTitleKey: "NUMOF", textKey: "DESC_ART", headerKey: "DATA_ENTREGA" }, childLayout:{ key: "DETALHES", primaryKey:"NUMOF", descriptionKey:"OBSERVACOES", ItemDetailsTemplate:"${COD_ART}", }
});
But i can't create the childLayout. What am i doing wrong?