Possible to get access to DataTextField on Expand?

2 posts, 0 answers
  1. axwack
    axwack avatar
    37 posts
    Member since:
    Aug 2012

    Posted 07 Feb Link to this post

    I could have a very n-deep treeview but the way the dataTextfield operates solves my problem. Is it possible, when the node is expanded, that you modify the array for which the dataTextField is displayed?

     For example:

     When the call is made to the service, the JSON Object return is:

    The first node name should be : VBN

    so the dataTextField: [SSM.securitySelectionModelName]

     

    {"id": 1, "isSSMNameNode": true, "tgtWeight": 0.0, "currWeight": 0.0, "hasChildNode": true, "ext_model_id": 1, "parent": null, "SSM": {"id": 1, "securitySelectionModelName": "VBN"}

     

    On the next get, it should be ["SSM.securitySelectionModelName", "SSM.classificationName]"

    [{"id": 2, "isSSMNameNode": false, "tgtWeight": 0.0, "currWeight": 0.0, "hasChildNode": true, "ext_model_id": 14, "parent": {"id": 1, "isSSMNameNode": true, "tgtWeight": 0.0, "currWeight": 0.0, "hasChildNode": true, "ext_model_id": 1, "parent": null, "SSM": 1, "classificationNameNode": null}, "SSM": {"id": 1, "securitySelectionModelName": "VBN", "classificationNameNode": {"id": 14, "classificationLevel": 2, "classificationName": "MBS", "hasChildNode": false, "parent": 2}}]

     Is this possible to do on the expand event where I create the dataTextField array dynamically?

  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 11 Feb Link to this post

    Hello axwack,

     

    As far as I understand your response for the root items and child items is different and you want to change the dataTextField configuration field. I am afraid that this can not be achieved without destroying and initializing the widget with the new setting (dataTextField option). 

     

    My suggestion is either to unify the responses to be in same format or change the response before passing it to the Kendo UI DataSource. The schema.parse  method should work for this case. 

     

    Regards,
    Boyan Dimitrov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top