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

Auto Generate Columns - not working #78

Open
FourieDeWet opened this issue May 18, 2016 · 4 comments
Open

Auto Generate Columns - not working #78

FourieDeWet opened this issue May 18, 2016 · 4 comments

Comments

@FourieDeWet
Copy link

FourieDeWet commented May 18, 2016

Hi Charles

I need to be able to generate the grid's columns from my data source (dynamic properties) but I cannot get the auto-generate-columns to work auto-generate-columns="true.

My simple grid looks like this:
<grid id="my-datagrid" read.call="getContacts($event)" auto-generate-columns="true"> <grid-row class="datagrid-row"> </grid-row> </grid>

The returned data:
getContacts(gridOptions) { return new Promise((resolve, reject) => resolve({ data: [ { "id": 1, "name": "my name", "email": "[email protected]" }, { "id": 2, "name": "my second name", "email": "[email protected]" }, ], count: 2 }));

If I manually add a column in the grid that row and column loads with data, but how to get the rest of the columns to autogenerate?

Thank you

@charlespockert
Copy link
Owner

You need to use .bind to pass a true value to a bindable property, otherwise it just gets the string value.

To be honest I should probably just be checking for truthyness but try auto-generate-columns.bind="true" and see if that works for you

@FourieDeWet
Copy link
Author

Thanks Charles for the quick response, but that did not do the trick. No
errors, it is just not generating the columns and rows for that matter.

I have made a bindable property as well passing in boolean value, no luck.

What else can I check for?

Thanks

On Wed, May 18, 2016 at 5:44 PM, Charles Pockert [email protected]
wrote:

You need to use .bind to pass a true value to a bindable property,
otherwise it just gets the string value.

To be honest I should probably just be checking for truthyness but try
auto-generate-columns.bind="true" and see if that works for you


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#78 (comment)

@charlespockert
Copy link
Owner

Er, I just checked the source and I never implemented this feature! Oops!

Shouldn't be too hard to add ... just need to inspect the datasource when it is bound provided and generate a column for each property

If you need a more functional alternative to this grid (since it's just mostly a tech demo) there are a couple of other projects that you might want to look at

An improved version of this exists at http://github.com/corneliutusnea/aurelia-grid

@FourieDeWet
Copy link
Author

Ahh ok, not a problem. It is a nice feature to have which I do require.

Thanks for the reference to another possible solution, will have to look to
see if it meets my requirements.

Looking forward to your update on this issue.

Thanks
On 18 May 2016 9:37 PM, "Charles Pockert" [email protected] wrote:

Er, I just checked the source and I never implemented this feature! Oops!

Shouldn't be too hard to add ... just need to inspect the datasource when
it is bound provided and generate a column for each property

If you need a more functional alternative to this grid (since it's just
mostly a tech demo) there are a couple of other projects that you might
want to look at

An improved version of this exists at
http://github.com/corneliutusnea/aurelia-grid
https://github.com/corneliutusnea/aurelia-grid


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#78 (comment)

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