![]() ![]() As the project grew, we quickly realized its limitations and had to come up with a solution that is flexible enough for a dev to take full control of the table from multiple places in the app as well as be composable enough to resemble a table structure. The reason I say this is because when starting with ELT, we too were very excited about Ember’s new declarative compatibilities when the whole notion of composable helpers was introduced. Once that read-only table needs some features added to it (ones that a declarative syntax can’t easily support), that’s when you have to decide if you need to switch to an alternate solution, create some app specific hacks, or take the time to incorporate new features into your current solution. My only concern here is future scalability. If you’re just in need of a simple read only solution, then yes, I think a fully declarative is pretty easy to get setup with and easy to maintain / read. I don’t think that a complete declarative solution is useless rather highly limited. Maybe my initial responsive was a bit harsh. In most cases (in the context of ELT) creating a cell or header component should do the job. If you’re code is clean, commented, and structured, then this should never really be an issue. Application sub-class on the same page Ember sortBy on. CSS class should be computed from row data. Hi, just wondering is there any simple way to add css class to table row. ![]() IMO, if you’re building / modifying / debugging an ember app, you SHOULD have JS knowledge. Coding example for the question Setting up multiple ember-light-tables on the same route-ember. Is the a way to add css class to table row. should all be in one place allowing anyone that looks at the JS + HBS to get a pretty clear understanding of what each column should be displaying and how the table should be rendered.Ĭannot easily customize the presentation of the table without knowledge of JavaScript If you create dedicated components for your tables, all your data / column definitions / layouts / etc. Honestly, this just comes down to code readability. It is not clear in the template what the presentation of the data (myData) is without looking in the component’s JS file. Now, the implementation isn’t perfect, but it is able to handle highly complicated needs and is modular enough to render pretty much anything, something that a fully declarative solution (currently) cannot achieve. Having access to a table instance allows you to be able to take complete control of the table and its data from anywhere in your application. Now what if you have external factors that need to take part in the rendering of your table? A button in a different component wants to toggle a header or a row, some service wants to add new columns to your table, or a route action wants to send your table into a loading state and begin fetching new rows. There’s a section of the UI with checkboxes, and the User can check/uncheck what columns they want in the UI, and this is persisted to the API server. The declarative syntax starts getting highly complicated with conditionals and your template starts to become unreadable. 1 Hi, I have a use case where I am using ember-light-table, and I want to make the columns configurable by the User.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |