We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

updating syncfusion version nodeCheck event of treeview not work

Thread ID:

Created:

Updated:

Platform:

Replies:

121947 Feb 10,2016 11:05 PM UTC Feb 12,2016 12:03 PM UTC ASP.NET Web Forms 3
loading
Tags: TreeView
Roimer Machacón Otero
Asked On February 10, 2016 11:05 PM UTC

Hi, we're using syncfusion treeview. In this day we update the version of the 12.2.0.36 to 12.4.0.34. Now testing the features we found that nodeCheck event of treeview not working in this new version.

What is the replace of this event? This not work when is a node parent, the node childs if work correctly

Piramanayagam Ramakrishnan [Syncfusion]
Replied On February 11, 2016 12:04 PM UTC

Hi Roimer,


We would like to inform you that, we have changed the behavior of the nodeCheck event to standard one. The nodeCheck event will trigger only for the particular node checked. But we can get list of recursive checked nodes from the currentCheckedNodes parameter of nodeCheck event argument. This currentCheckedNodes parameter consists of the collection of currently checked node’s object (parent node, current node, child node) which contains nodeId and nodeText. Based on this we can get the recursive checked node.


For your reference, we have prepared a sample to showcase that we can get all recursive checked nodes when we check the particular node.


Sample Location: TreeView sample


Similarly we can get the recursive unchecked nodes from currentUncheckedNodes parameter of nodeUncheck event argument. This currentUncheckedNodes argument consists of the collection of currently unchecked node’s object (parent node, current node, child node). But unfortunately, unchecked node’s object didn’t contain corresponding nodeId but it contains only node text to this arguments in version 12.4.0.34.


We have fixed this issue in versions 13.1.0.21 and later. We request you to upgrade to the latest version to resolve this issue.

 

Regards,

Piramanayagam R


Roimer Machacón Otero
Replied On February 11, 2016 08:17 PM UTC

Hi this is a fragment of javascript code that using:

function planesSeleccionados(lblPlanes, lblFechaInicio, lblFechaFin, tvPlanes, gvsDetalles, gvsRecursos, listaPlanes, checkbox, estado, campoOcultoEstado) {
    var arbol = $(tvPlanes).ejTreeView();
    var lista;
    $(tvPlanes).ejTreeView({
        nodeCheck: function (args) {
            if (estado == "procesar") {
                lista = [];
                listaPlanes = [];
                campoOcultoEstado.value = "";
            }
            var plan = args.value;
            listaPlanes.push(plan);
            lista = limpiarLista(listaPlanes);
            limpiarGrilla(gvsRecursos);
            //cargarRecursos(lista, gvsRecursos);
            mostrarFechaInicioPlanes(lblFechaInicio, lista);
            mostrarFechaFinPlanes(lblFechaFin, lista);
            mostrarPlanesSeleccionados(lblPlanes, lista)
            cargarDetalles(lista, gvsDetalles);
        },
    });
}


For us the code line more important is this: var plan = args.value; 
In the version 12.2.0.36 apply un console.log for the var plan this return a list of all nodes checked when the checked is a parent node (Image 1 attached), now this same script in the version 12.4.0.34 o using the console.log only return the value of the parent node (Image 2 attached).

Please help us with this.

Attachment: treeview_log_4de1500d.rar

Piramanayagam Ramakrishnan [Syncfusion]
Replied On February 12, 2016 12:03 PM UTC

Hi Roimer,


Thanks for your update.


We have analyzed your query and given code block. We can achieve your requirement (“to get a list of all nodes checked when the checked is a parent node”) using nodeCheck event of TreeView control. As we have previously mentioned, we can get list of all recursive checked nodes from the currentCheckedNodes parameter of nodeCheck event argument when we check a particular node (parent node) in TreeView control. From this argument parameter, we can get the checked node (parent node) and all recursive checked nodes (child nodes) text using nodeText parameter of currentCheckedNodes. Please refer the below code sample,


[HTML]

$("#treeView").ejTreeView({

    fields: { id: "id", parentId: "pid", text: "name", hasChild: "hasChild", dataSource: localData, expanded: "expanded" },

    showCheckbox: true,

    nodeCheck: function (args) {

        if (args.currentCheckedNodes) {

            var nodes = args.currentCheckedNodes;

            for (var i = 0; i < nodes.length; i++) {

                var plan = nodes[i].nodeText;

                $("#eventslog").val($("#eventslog").val() + plan + "\\\n");

            }

        }

    }

});


For your reference, we have prepared a sample to showcase that we can get a list of all nodes checked when the checked is a parent node.


Sample Location: TreeView_JS_Sample


Please let us know whether the provided sample is helpful in achieving your requirement. If not, get back to us with more information for us to assist you.


Regards,
Piramanayagam R


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;