Hello,
I am new to outsystems. I am currently using a datagrid in my screen and I have a few questions that I hope someone can help answer:
1) Am I able to format the datagrid in a way that there is no empty space to the side. Is there a setting where I can get the columns shown to fill the empty space
2) Datagrid allows the user to drag and drop columns to create groups. Is there a way to group it by the Month column for example by default? So everytime i launch the application, the datagrid will automically be grouped by Month and I dont have to manually drag the month column.
3) The datagrid in outsystems service studio looks like the image shown below. Is there a way for it to show the columns in the datagrid similar to how it would look like after publishing?
Hello @Low Ding En
Let me try to answer one by one
OutSystems.GridAPI.GridManager.GetGridById($parameters.GridWidgetId).provider.columns.forEach( function(col) { col.width = '*'; });
Hope it helps!
Cheers,GM
Thank you so much for the clarification! I appreciate it!
Sorry, for further clarification,
1) For this script that I will be adding to the OnInitialise event of the grid:
How am I able to get the GridWidgetId? And am i suppose to put this in a Javascript node in a event handler?
2) Same question here, how am I able to find the GridWidgetId and the ColumnWidgetIds?
For both scenarios, like in any element in OutSystems language, you just need to provide a name to the element and it will be available on every expression editor:
Thank you again. Sorry again for the many questions!
1) Am I doing it right? I have rename the grid to Savings but it still doesnt seem to work.
2) I assume that the AddColumnsToGroupPanel client action doesnt work with the autogenerated Grid? So I had have manually add the different columns instead of using a autogenerated grid?
1) Thank you so much! Its working now! I am new to outsystems and this is my first time working with Javescript! Sorry for taking so long to understand this!
2) One last question! For the column blocks, I am struggling with getting the binding portion:
I understand it needs to be in the format of entityname.fieldname but I dont have any option when selecting it. What am i suppose to do?
The binding of a column is the field that will be mapped into this column. Remember that the Datagrid receives JSON so the binding is for instance <EntityName>.<AttributeName> - e.g. "User.Name" will be binding to a column where you want to show the user's name if you're listing the list of Users.
If you're new to OutSystems and using the Data Grid I would advise taking the learning paths to learn how to work with the platform since the Data Grid is a more advanced use case. For the Data Grid, I would really suggest checking the Sample that can be found here, where you can see a lot of information about the features and where you have access to the working examples to learn how to do it.
Cheers and good luck on this journey (welcome :) )
Will do! Thanks again for taking the time to help me with this! I really appreciate it!