- Home
- Forum
- Angular - EJ 2
- NgIf for boolean value are not working on Grid columns after changing the value
NgIf for boolean value are not working on Grid columns after changing the value
Hello Madam/ Sir,
I am facing some weird issue regarding the Syncfusion Grid columns. I will explain briefly on below,
1) I have one grid table having 7 columns and one Multiselect dropdown that contains the column names of grid table with checkboxes.
2) I want to hide/show column as per the column selection in dropdown.
3) I am keeping the history of checked/unchecked columns using localstorage, it means whenever user select/unselect the value from dropdown, value of that variable is storing in localstorage & whenever user revisit the page I am extracted values from localstorage and applying to columns to hide/show.
4) The main problem is, I got the value correctly from localstorage but it is not reflecting to Grid template or grid html. Please check the below code.
// For storing value to localstorage when ever user check/uncheck the columns,
localStorage.setItem('column1', JSON.stringify(true));
// Getting value from localstorage
let columnOne = JSON.parse(localStorage.getItem('column1'));
// Now applying the value to Grid, it is not reflecting
{{ columnOne }} <!-- It showing here columnOne value correctly but not in below -->
<ejs-grid #dataSourceGrid [dataSource]='testDataSource' allowSorting='true'>
<e-columns>
<e-column field='column1' headerText='Column 1' width='70' [allowSorting]='true'
*ngIf="columnOne">
</e-column>
</e-columns>
</ejs-grid>
5)After the selection/de-selection process of columns, values are getting correctly but not reflecting to Grid columns.
6) When user deselect the column name, column get false and it has hidden. Next time when user select the value of respective column it is showing true value but not showing the column which is hidden by *ngIf.
7) I think the boolean value is not properly rendering to Grid system.
Please note: I haven't provided any code or any function calls regarding this. Please check the above and if you required the code regarding the scenario, I will generate some demo example on "StackzBlitz" and let you know.
Thanks & Regards,
Siddharth
SIGN IN To post a reply.
3 Replies
RR
Rajapandi Ravi
Syncfusion Team
June 22, 2020 11:55 AM UTC
Hi Siddharth,
Greetings from syncfusion support
Before we start providing solution on your query, Please share the below details that will be helpful for us to provide better solution.
1) Please share your complete Grid rendering Code.
2) Please reproduce the issue with stackblitz sample.
3) If possible, share your issue scenario in video demonstration format.
Regards,
Rajapandi R
SK
Siddharth Kulat
July 1, 2020 02:08 PM UTC
Hello Sir,
Yes I will generate one example regarding that and let you know.
Thanks,
MF
Mohammed Farook J
Syncfusion Team
July 2, 2020 05:46 PM UTC
Hi Siddharth,
Thanks for your update.
We are waiting for your response.
Regards,
J Mohammed Farook
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
-
SK Siddharth Kulat
- Jun 19, 2020 06:19 AM UTC
- Jul 2, 2020 05:46 PM UTC