Forums de discussion
Aui Tree View -Get all selected value in a tree view
mohammad azaruddin, modifié il y a 9 années.
Aui Tree View -Get all selected value in a tree view
Expert Publications: 492 Date d'inscription: 17/09/12 Publications récentes
Hi all how to get all selected checkbox value of child in a tree view...?
I can able to get the last selected checkbox value
And how to set value for a checkBox
I can able to get the last selected checkbox value
And how to set value for a checkBox
<%@ taglib uri="http://alloy.liferay.com/tld/aui" prefix="aui" %>
<div id="myTreeView" style="border-right:1px solid #D9DADB;"></div>
<aui:script>
AUI().use(
'aui-tree-view',
function(A) {
new A.TreeViewDD(
{
boundingBox: '#myTreeView',
children: [
{
children: [
{label: 'Learn Spanish', leaf: true, type: 'task'},
{label: 'Learn Salesforce', leaf: true, type: 'task'},
{label: 'Hibernate Course', leaf: true, type: 'task'},
{label: 'Finance & Magaement', leaf: true, type: 'task'},
{label: 'More', leaf: true, type: 'task' , color: 'blue'}
],
expanded: true,
label: 'Title',
type: 'task'
}
],
after: {
lastSelectedChange: function(event){
alert("LAST SELECTED VALUE-->"+event.newVal.get('label'));
}
}
}
).render();
}
);
</aui:script>
mohammad azaruddin, modifié il y a 9 années.
RE: Aui Tree View -Get all selected value in a tree view
Expert Publications: 492 Date d'inscription: 17/09/12 Publications récentes
HI all
Any solution...?
Any solution...?
Meera Prince, modifié il y a 9 années.
RE: Aui Tree View -Get all selected value in a tree view
Liferay Legend Publications: 1111 Date d'inscription: 08/02/11 Publications récentes
Hi
Find the parent element which wrap the all check box values
try as follows
A.all('input[type=checkbox]').each(function (node) {
if (node.getAttribute('checked')==''checked') {
}
});
reference
http://www.jsrosettastone.com/
Find the parent element which wrap the all check box values
try as follows
A.all('input[type=checkbox]').each(function (node) {
if (node.getAttribute('checked')==''checked') {
}
});
reference
http://www.jsrosettastone.com/
mohammad azaruddin, modifié il y a 9 années.
RE: Aui Tree View -Get all selected value in a tree view
Expert Publications: 492 Date d'inscription: 17/09/12 Publications récentes
Hi prince Unable to get the result..Is that is working for you...?
I notice that there is no cheked attribute in that check box and when i check the check box class tree-node-checked append to the parent div
I notice that there is no cheked attribute in that check box and when i check the check box class tree-node-checked append to the parent div
mohammad azaruddin, modifié il y a 9 années.
RE: Aui Tree View -Get all selected value in a tree view
Expert Publications: 492 Date d'inscription: 17/09/12 Publications récentes
HI meera
I can able to get if the node is checked(node.get('checked')) but unable to get the other details about the node ie (node.get('label'))
A.all('input').each(function (node) {
alert(node.get('label')+" Is checked--"+node.get('checked'));
});
I can able to get if the node is checked(node.get('checked')) but unable to get the other details about the node ie (node.get('label'))
A.all('input').each(function (node) {
alert(node.get('label')+" Is checked--"+node.get('checked'));
});
Meera Prince, modifié il y a 9 années.
RE: Aui Tree View -Get all selected value in a tree view
Liferay Legend Publications: 1111 Date d'inscription: 08/02/11 Publications récentes
Hi
The check box have label attribute then only it can give man i guess label is not attribute for check box ok.
type , value, name, id are the attributes if you want then you can use your custom attribute as follows i.e. label for your check box.
Like
<input type="checkbox" label="checkbox1" value=""/>
Try this
in your case label is not an attribute of check box ok
Regards,
meera prince
The check box have label attribute then only it can give man i guess label is not attribute for check box ok.
type , value, name, id are the attributes if you want then you can use your custom attribute as follows i.e. label for your check box.
Like
<input type="checkbox" label="checkbox1" value=""/>
Try this
A.one('#parentNodeWrappedAllCheckBoxes').all('input[type=checkbox]').each(function (node) {
if (node.getAttribute('checked')=='checked') {
alert(node.getAttribute('label'))
}
});
in your case label is not an attribute of check box ok
Regards,
meera prince
mohammad azaruddin, modifié il y a 9 années.
RE: Aui Tree View -Get all selected value in a tree view
Expert Publications: 492 Date d'inscription: 17/09/12 Publications récentes
Hi Prince It is working
Below is the working code for two events...We can use either one and lastSelectedChange event sometime not working if i check and uncheck parent check box ...
Below is the working code for two events...We can use either one and lastSelectedChange event sometime not working if i check and uncheck parent check box ...
<%@ taglib uri="http://alloy.liferay.com/tld/aui" prefix="aui"%>
<div id="myTreeView" style="border-right: 1px solid #D9DADB;"></div>
<aui:script>
AUI().use(
'aui-tree-view',
function(A) {
var treeView=new A.TreeViewDD(
{
boundingBox: '#myTreeView',
children: [
{
children: [
{label: 'Learn Spanish', leaf: true, type: 'task',id: '11'},
{label: 'Learn Salesforce', leaf: true, type: 'task',id: '12'},
{label: 'Hibernate Course', leaf: true, type: 'task',id: '13'},
{label: 'Finance & Magaement',leaf: true, type: 'task', id: '14'},
{label: 'More', leaf: true, type: 'task' ,id: '15'}
],
expanded: true,
label: 'Title',
type: 'task'
}
]
}).render();
treeView.on('click', function(event){
alert("on click event");
getCheckedElement(treeView);
});
treeView.after("lastSelectedChange", function(event) {
alert("after lastSelectedChange event");
getCheckedElement(treeView);
});
});
Liferay.provide(
window,
'getCheckedElement',
function(product_configurator_tree) {
var nodeList = new Array();
nodeList = product_configurator_tree.getChildren(true);
var attrNodeObj = "";
for( var i = 0 ; i < nodeList.length ; i++){
alert(nodeList[i].isChecked()+"---------"+nodeList[i].get("label"));
}
});
</aui:script>
Madasamy P, modifié il y a 7 années.
RE: Aui Tree View -Get all selected value in a tree view
Junior Member Publications: 90 Date d'inscription: 27/07/16 Publications récentes
Am I give the label as one variable name contains String value and I want to use loops in tree structure
Madasamy P, modifié il y a 7 années.
RE: Aui Tree View -Get all selected value in a tree view
Junior Member Publications: 90 Date d'inscription: 27/07/16 Publications récentes
I want looping to displays the muliple file names as label
What can I do for it?
What can I do for it?