Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
Issue with new IgrGrid
posted

Hi

I want some clarification on the new IgrGrid (www.infragistics.com/.../data-grid).

1) Earlier in IgrDataGrid we have IgrDateTimeColumn in which we can display DateTime in our format but now in IgrGrid we have IgrColumn in which I'm unable to display DateTime in this format -> (dd/mm/yyyy, hours:min:sec AM). I used the same approach that I have used earlier but the format which is appearing on the UI is (month date, year,hours:min:sec AM) eg: (July 20, 2023, 10:14:06 AM). So how can I display the same in (dd/mm/yyyy, hours:min:sec AM) format (eg: 07/10/2023, 10:14:06 AM).

2) Earlier in IgrDataGrid we set a property "sortable:true" in a column in order to give the functionality of sorting and same we can do in IgrGrid, but in IgrDataGrid the sorting indicator can only be seen when we click on the header but in IgrGrid the sorting indicator can be seen from the very starting. So, how to display the sorting indicator only when we click on the header?

3) In IgrDataGrid we have grid.loadLayout() (at time of grid ref) option but now in IgrGrid I'm unable to find this option. So how to use loadLayout and saveLayout thing in IgrGrid?

4) In IgrGrid when we display the grid on UI without data then in the middle it is written that "Grid has no data" (refer the ss attached). How to remove this text and keep it blank?



Please refer all the above mentioned points and suggest the approach to achieve the same point wise.

Best Regards
Bharat

Parents
  • 34810
    Offline posted

    Hello Bharat,

    Thank you for your post on this matter. I will answer your inquiries in the order they were asked.

    1. In the IgrGrid, the columns expose a property called formatter that allows you to define a function to format the data in that column and provide the string that you wish to display. The signature for this function looks like the following:

    public myFormatter(value: any, rowData: any){       
            return "FORMATTED STRING HERE";
    }

    The value parameter in this case will be the cell value being formatted and the rowData will be the full underlying data item to the row. You will need to parse your date value and return it in the value that you wish to see.

    2. The current behavior of the IgrGrid is that you need to click on the sort indicator to sort the column and it will be highlighted if the column is sorted. If you hide all of the sort indicators initially, you will not be able to sort the column without some additional application code.

    If you wish to go the application code route though, you will need to use the headerTemplate property of the columns and provide a template for your headers that hooks a click event so you can detect a click in the header. In that click event, you would need to modify the sortingExpressions collection of the grid.

    3. Save and load layout is something that is under development for the IgrGrid component and will be available in a future version.

    4. You can utilize the emptyGridMessage property on the grid for this. If you set this to an empty string, you should be able to remove it.

    Please let me know if you have any other questions or concerns on this matter.

Reply Children