Hiding and Sorting fields in the ConfigurationPanel

2 posts, 0 answers
  1. chrisL
    chrisL avatar
    64 posts
    Member since:
    Dec 2005

    Posted 03 Aug 2014 Link to this post

    Hi there.

    How can I hide certain fields in the All Fields list in the ConfigurationPanel?

    I can iterate through the pvtAD.Fields collection in the pvtAD_PreRender method and find the fields I want to hide but when I use pvtAD.Fields[i].IsHidden = true; it doesn't hide it. It still appears and also the update doesn't work when I apply any config changes.

    And how can I do something like this?
    pvtAD.Fields = pvtAD.Fields.OrderBy(x => x.Caption).ToList();

    Many thanks,
    Chris 
  2. Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 07 Aug 2014 Link to this post

    Hello Chris,

    You can use the following approach to access the field elements:
    <ClientSettings>
        <ClientEvents OnPivotGridCreated="pivotGridCreated" />
    </ClientSettings>
    JavaScript:
    function pivotGridCreated(sender, args) {
        var panel = sender.get_configurationPanel().get_element();
        var container = $(panel).find("rpgAllFieldsContainer,.rpgFieldsContainer")[0];
        var fields = $(container).children();
     
        fields.each(function (i, el) {
            if (el.id.endsWith("_ShipName_Hidden") || el.id.endsWith("_ShipCountry_Hidden")) {
                el.style.display = "none";
            }
        });
    }

    Hope this helps.

    Regards,
    Eyup
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top