Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically creating Datagrid rows #806

Open
AshRaghav opened this issue Mar 19, 2017 · 4 comments
Open

Automatically creating Datagrid rows #806

AshRaghav opened this issue Mar 19, 2017 · 4 comments

Comments

@AshRaghav
Copy link

Hi,

I have got a dropdown list outside the Datagrid and any value selected should populate a set of rows inside the Datagrid automatically when I save the document. Once the rows are created, I am allowing the user to input values on specific fields inside the Datagrid.

Is there a way to automatically create a set of rows in Datagrid with specific values in the first column based on a particular selection outside the Datagrid?

Thanks.

@AshRaghav
Copy link
Author

@ebrehault - any thoughts on this?

Also - I am struggling to validate whether a user has pressed "enter" button against each datagrid row in inline editing. Is there a way to validate this action?

The reason to validate the enter button is because users generally forget to press the enter key and click on the save button at the end of the form, thinking that it'll automatically save the entered datagrid rows. Datagrid seems to be saving values only when we press enter button when using inline editing.

Any ideas is much appreciated. Thanks

@ebrehault
Copy link
Member

Regrading creating rows automatically: yes that's possible, in onSave you can set a datagrid (just like any other field value):

context.setItem('mydatagrid', [['first col row1', '', ''], ['first col row2', '', '']])

Regarding inline validation check, I guess a custom js could do that.

@AshRaghav
Copy link
Author

Thanks @ebrehault - that would be great. I'm not quite adept with js and especially with validating the button press. I also want to change the label of the button to "Save" rather than "Enter" to make it more meaningful.

Secondly I noticed that if I add multiple rows first without pressing enter on the first row, there appears to be a slightly weird behaviour with saving. It seems to take ages and sometimes doesn't save.

Thirdly, if there are any mandatory fields in the associated form of a datagrid and if a user fails to enter this data, no alert is generated except a spinning wheel which was also confusing me for sometime. Not sure if there is a way to fix this.

Thanks again.

@AshRaghav
Copy link
Author

@ebrehault , Also - is there a way to retrieve the parameters sent by aoData.push of Datatables inside plomino formulas?

The reason for this question is because I have dropdown list which is populated based on the selection in the previous form and at the moment I am managing to pass the previous selection through Query string and reading that data in the form associated to the Datagrid.

If I try to edit a previously entered value then the data from Query string is lost and my dropdown list gets bigger than it should. In fact, this method works only with inline editing and Query string is not available if I use the modal format for the Datagrid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants