Nanthaphol
Top achievements
Rank 1
Nanthaphol
asked on 30 Jul 2012, 06:45 AM
Hi, I'm try to insert node in treeview like demo
this is my code
var treeviewData = $("#treeview").data("kendoTreeView");
var selectedNode = treeviewData.select();
treeviewData.append({text: Name}, selectedNode);
,but after insert at child node is undefined data
can I fix this problem
this is my code
var treeviewData = $("#treeview").data("kendoTreeView");
var selectedNode = treeviewData.select();
treeviewData.append({text: Name}, selectedNode);
,but after insert at child node is undefined data
can I fix this problem
6 Answers, 1 is accepted
0
Ambica
Top achievements
Rank 1
answered on 31 Jul 2012, 11:10 AM
Hi,
Even I am facing same problem , its not working for first element as well.
Even I am facing same problem , its not working for first element as well.
var treeView = $("#divTreeView").data("kendoTreeView");
treeView.insertAfter({ text: "JavaScript" }, $("#firstItem"));
Please any one help us.
Please any one help us.
0
Ambica
Top achievements
Rank 1
answered on 31 Jul 2012, 12:20 PM
we have to give $(selectedNode) instead ofselectedNode as below.var treeView = $("#divTreeView").data("kendoTreeView"); var selectedNode = treeView.select(); treeView.append({ text: "Meanwhile, in HTML5..." }, $(selectedNode)); Its working ....
0
Nanthaphol
Top achievements
Rank 1
answered on 01 Aug 2012, 04:12 AM
I see problem by Javascript Debug
you can see this line "treeviewData.append({text: Name}, selectedNode); "
text : " " isn't data to show on child node,you can solve this problem by
treeviewData.append({Name:$("#name").val(),id:id_node}, selectedNode);
you can see Name: is set data to show on child node and you can set id node too
thx everyone
you can see this line "treeviewData.append({text: Name}, selectedNode); "
text : " " isn't data to show on child node,you can solve this problem by
treeviewData.append({Name:$("#name").val(),id:id_node}, selectedNode);
you can see Name: is set data to show on child node and you can set id node too
thx everyone
0
ali
Top achievements
Rank 1
answered on 31 May 2015, 06:53 PM
i used name property instead of text or title
and worked
treeview.append({
Name: nodeText,
id: nodeValue
}, selectedNode);
0
JV
Top achievements
Rank 1
answered on 06 Feb 2018, 07:41 PM
does any one have a similar problem like this?
code js ->
controllerx.grid_options ={
rowTemplate: kendo.kendoTreeView($("#mx-Ensemble").html()), <-- this does not work
}
but when I use
controllerx.grid_options ={
rowTemplate: kendo.template($("#mx-Ensemble").html()), <-- this does WORK
}
HTML -> code
<script id="mx-Ensemble" type="text/x-kendo-tmpl"> </script>
<div kendo-grid="mainGrid" options="vm.options"></div>
0
Hello,
kendo.kendoTreeView is not a valid API method. The HTML passed as rowTemplate must be a <tr> element. As specified in the documentation the Grid's rowTemplate option expects either a string, for example:
or a function:
The kendo.template method returns the generated HTML string, which again must contain a <tr> element.
Regards,
Ivan Danchev
Progress Telerik
kendo.kendoTreeView is not a valid API method. The HTML passed as rowTemplate must be a <tr> element. As specified in the documentation the Grid's rowTemplate option expects either a string, for example:
rowTemplate:
'<tr data-uid="#= uid #"><td colspan="2"><strong>#: name #</strong><strong>#: age #</strong></td></tr>'
rowTemplate: kendo.template($(
"#template"
).html())
The kendo.template method returns the generated HTML string, which again must contain a <tr> element.
Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.