jQWidgets Forums

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts

  • eitdhc
    Member

    thanks for the quick reply, however, with the dataset I have, building a source array as outlined in your example is not practical.

    Upgrade Request –
    Using the dataAdapter and getRecordsHierarchy method (awesome upgrade by the way!): allow me to add a datafield to my source array that can be mapped into the tag.

    example:

    var source =
    {
    datatype: “json”,
    datafields: [
    { name: ‘asset_registry_id’ },
    { name: ‘parent_id’ },
    { name: ‘tree_display_name’ },
    { name: ‘asset_registry_id’ },
    { name: ‘is_approved’ }
    ],
    icon: ‘~/asset_registry/treeimages/1.png’,
    id: ‘asset_registry_id’,
    localdata: jR.items
    }

    var dataAdapter = new $.jqx.dataAdapter(source);
    dataAdapter.dataBind();

    var records = dataAdapter.getRecordsHierarchy(‘asset_registry_id’, ‘parent_id’, ‘items’, [{ name: ‘asset_registry_id’, map: ‘value’ }, { name: ‘tree_display_name’, map: ‘label’}, { name: ‘is_approved’, map: ‘data-tree-is-active’}]);

    This would allow for custom CSS (and even images) with a simple jQuery .find().each() call after your tree is initialized.

    Likewise, { name: ‘my_custom_css_class’, map: ‘class’} could possibly just add my_custom_css_class to the <li class="…." renderer.

    Just some thoughts that are based on actual requirements for a current project that would keep me using the jqwidgets tree.

Viewing 1 post (of 1 total)