C1TreeView How to disable unselect

Originally Posted 13 January 2015, 11:41 am EST

  • Originally Posted 13 January 2015, 11:41 am EST

    HI


    In C1TreeView NetHelp - TreeView Appearance and Behavior > Node Selection :

    ...To unselect a node, click on it again...

    How can I disable the unselect mode, I don't wanna unselect the selected node.

    Best regards

    Chris
  • Reply

    Hello Chris,

    If you want to disable the de-select mode then you can achieve the same using the following script:
          $(document).ready(function () {
    $("#C1TreeView1").c1treeview({
    //handle the check changing event
    nodeCheckChanging: function (e, data) {
    //check if the node is selected
    if (data.options.checked == true)
    //cancel it
    return false;
    }
    });

    });


    Regards

    Regards
  • Reply

    @ashishjindal said:
    Hello Chris,

    If you want to disable the de-select mode then you can achieve the same using the following script:
          $(document).ready(function () {
    $("#C1TreeView1").c1treeview({
    //handle the check changing event
    nodeCheckChanging: function (e, data) {
    //check if the node is selected
    if (data.options.checked == true)
    //cancel it
    return false;
    }
    });

    });


    Regards

    Regards


    HI

    The version of my wijmo maybe older - wijmo 2014v1,
    so there have no nodeCheckChanging event,
    and I think the event should be selectedNodeChanging (not nodeCheck...),
    but there have no selectedNodeChanging event for cancel node-selection too.

    *I think Wijmo API on-line document should marks the version for new property/method/event.
    *My wijmo 2014v1 licenses was expired so unable upgrade to new version of wijmo (2014v3~).

    Best regards

    Chris



  • Reply

    Hello,

    The above applies when you have checkbox in nodes. I would suggest you to catch the nodeClick event and cancel the event if the node is already selected.


    Thanks,
    Deepak Sharma
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels