Update TableSheet IColumn Style

Posted by: michael.thrift2 on 12 September 2022, 7:32 am EST

    • Post Options:
    • Link

    Posted 12 September 2022, 7:32 am EST

    Is it possible to change properties on an IColumn that is currently being viewed? I make the changes I want (such as changing the caption or the formatter), but the changes do not show.

    I’ve tried invoking refresh(), invalidateLayout() & repaint().

  • Posted 12 September 2022, 10:37 pm EST

    Hi,

    For this, you may need to change the column Info and call the refereshBindColumns method. Please refer to the following code snippet and let me know if you face any issues,

    
    tableSheet.getDataView().setColumnInfos([
                { value: "Id", width: 80,width: 300 },
                { value: "CompanyName", width: 200, caption :"Company Name" },
                { value: "ContactName", width: 150, caption :"Contact" },
                { value: "ContactTitle", width: 200, caption :"Title" },
                { value: "Address", width: 200 },
                { value: "City", width: 150, caption :"City" },
                { value: "State", width: 100, caption :"State" },
                { value: "Region", width: 100, caption :"Region" }
            ]);
    tableSheet.refreshBindColumns();
    
    

    Regards,

    Avinash

  • Posted 13 September 2022, 11:51 pm EST

    Avinash,

    This worked! Thank you! The API definitions and the typescript definitions for TableSheet do not list a “refreshBindColumns” method. I always assumed that TableSheet must sit ontop of some existing class like Table or Worksheet but those don’t have a method for “refreshBindColumns” either.

    Do you have any recommendation for how I can “discover” object methods that may be of use, but that aren’t as well documented?

  • Posted 14 September 2022, 6:05 pm EST

    Hi,

    We have requested the doc team to add this method in docs. Further for debugging what you do is log the object prototype in the console you access all the methods from there even though if some of the methods are not mentioned in the doc.

    Regards,

    Avinash

  • Posted 19 September 2022, 4:59 pm EST

    HI,

    The team informed us this is an internal method which is why it no mentioned in doc. You may use the setDataView for refreshing the view again. Please refer to the following code snippet and let me know if you face any issues.

    
    view.setColumnInfos([
                { value: "Id", width: 80,width: 300 },
                { value: "CompanyName", width: 200, caption :"Company Name" },
                { value: "ContactName", width: 150, caption :"Contact" },
                { value: "ContactTitle", width: 200, caption :"Title" },
                { value: "Address", width: 200 },
                { value: "City", width: 150, caption :"City" },
                { value: "State", width: 100, caption :"State" },
                { value: "Region", width: 100, caption :"Region" }
            ]);
    tableSheet.setDataView(view);
    
    
    
    

    Regards,

    Avinash

Need extra support?

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

Learn More

Forum Channels