onechiporenko / ember-models-table

Table with pagination, sorting, filtering and much more
https://onechiporenko.github.io/ember-models-table/v.5/plain-html/#/examples
MIT License
222 stars 134 forks source link

Addon is unusable with Ember 2.15 #239

Closed onechiporenko closed 6 years ago

onechiporenko commented 7 years ago
steverhoades commented 7 years ago

@onechiporenko I just attempted to upgrade to 2.15 and see why this issue was created.

Do you know what in 2.15 broke this add-on? I'd like to help if possible but at the moment there isn't a clear error indicating where this add-on is failing.

What I am seeing is empty rows in the table and an error being thrown on click.

ember-metal.js:3988 TypeError: Cannot read property 'get' of undefined
    at Class.onRowSelect (route.js:171)
    at Router$1.triggerEvent (router.js:1017)
    at trigger (router.js:111)
    at Router$1.trigger (router.js:1699)
    at Class.send (router.js:327)
    at Class.send (action_handler.js:42)
    at Class.triggerAction (target_action_support.js:89)
    at Class.sendAction (action_support.js:115)
    at Class.clickOnRow (component.js:44)
    at Class.send (action_support.js:129)
steverhoades commented 7 years ago

@onechiporenko Adding the following issue so it can be tracked. I believe this is related to the breakage of this add-on in 2.15.

https://github.com/emberjs/ember.js/issues/15621

onechiporenko commented 7 years ago

Hi, @steverhoades. Something become broken with partials on Ember-2.15. Since Ember core-devs recommended to not use partials and move to the contextual components I have to do this too. Branch v2.0 (https://github.com/onechiporenko/ember-models-table/tree/v2.0) contains new version of ember-models-table. It's not published yet, but i'm working on it.

mydea commented 7 years ago

I now it is still WIP, but may I recommend that you nest the components? I think that would make it easier to grasp & to override it.

E.g.:

components/models-table.js components/models-table/select.js components/models-table/footer.js components/models-table/row.js ...

You can use these nested components normally in the template, e.g. {{models-table/row}}.

onechiporenko commented 7 years ago

@mydea, thanks. I think I'll do as you said. It's a good idea! 2.0 is big major release with great changes, so fill free to propose/ask/recommend :)

mydea commented 7 years ago

Awesome! Is there a place for recommendations etc, or should I just put them here? I would also be up to help out if there is anything you'd need help with - ember-models-table is an integral part of our products, so I'm happy to give back :)

onechiporenko commented 7 years ago

Yes, you may put it here.

I would also be up to help out if there is anything you'd need help with

Thanks! For now I need a "fresh outlook" (IDK, if it's a correct translation from "свежий взгляд со стороны").

"Coding part" contains next items:

onechiporenko commented 7 years ago

ember-models-table is an integral part of our products, so I'm happy to give back :)

I'm really glad that ember-models-table is useful for your products :)

Ramblurr commented 7 years ago

The discussion here has left me a little confused. Glad to see 2.0 is coming along :-D

But, is version 1.x going to be updated to support Ember >= 2.15?

onechiporenko commented 7 years ago

@Ramblurr, upgrading 1.x means that some partials (IDK all partials or only a part of them) should be combined into one template. As for now, it's not a problem with addon itself. Yes, I've used not best practice with partials instead of components, but partials are supported currently and are not deprecated officially. Some error happens with Ember (or Glimmer or any other lib). I believe that bug emberjs/ember.js#15621 will be fixed and v1.x will continue work correctly.

Ramblurr commented 7 years ago

Good to hear! I didn't realize this was caused by a bug in Ember rather than a deprecation/change. Thanks @onechiporenko

onechiporenko commented 7 years ago

v2.0.0-alpha.1 is released. It's a pre-release for anyone who wants to test new design and help to improve it.

Run ember ember-cli-yuidoc to build docs-dir

majesticblvd commented 7 years ago

Hey, first of all thanks for a great addon! When using Ember 2.15 with v2.0.0-alpha.1 branch, the column template functionality is not working (the cells are now blank). propertyName cells are still showing up correctly.

Keep up the good work!

onechiporenko commented 7 years ago

@DennisNygren, main idea for version 2. is replace templates (partials) with contextual and "normal" components. So, upgrade to version 2. requires refactoring. Some migration docs will be prepared later. For now - just replace partials with components.

onechiporenko commented 7 years ago

v2.0.0-beta.1 is released.

majesticblvd commented 7 years ago

@onechiporenko Ok thanks for your quick reply!

arnebit commented 7 years ago

Great work so far!

Is there a particular reason not to pass table=this to a componentForFilterCell anymore?

That used to be the case before and I relied on it (on accessing processedColumns in particular) to implement filter options dependent on another filter (subcategory <- main category).

onechiporenko commented 7 years ago

@arnebit, componentForFilterCell receives several properties (see https://github.com/onechiporenko/ember-models-table/blob/v2.0/addon/templates/components/models-table/row-filtering.hbs#L16). Let me know if something more is needed.

Passing table=this is a bad practice that I shouldn't use before (but I did :cry:)

onechiporenko commented 7 years ago

v2.0.0-beta.2 is released.

cmonzon44 commented 7 years ago

Separated issue is created https://github.com/onechiporenko/ember-models-table/issues/254

=========== edited by @onechiporenko

arnebit commented 7 years ago

@onechiporenko Why is passing table=this bad? Because it would give the user...flexibility? ;-)

The aforementioned processedColumns aside, looking for table. in my project, I find I am also accessing/using

onechiporenko commented 7 years ago

Check new demo page for v.2 http://onechiporenko.github.io/ember-models-table/v.2/

onechiporenko commented 7 years ago

v2.0.0-beta.3 is released.

GSakunthala commented 7 years ago

I am using ember-model-table 2.0beta after the issue came up with "partials" in ember 2.15.I want to know if there is an option to customize the pagination in 2.0 such as "componentFooterTemplate" in 1.0? Pls help as it affects my app in production.

onechiporenko commented 7 years ago

@SakuDivya, sure. You may override models-table/footer or use block content like:

{{#models-table data=data columns=columns as |mt|}}
  {{#mt.footer as |footer|}}
    {{! custom markup here }}
  {{/mt.footer}}
{{/models-table}}
onechiporenko commented 7 years ago

Short diff-manual for migration from 1.x to 2.x is here - en/ru

GSakunthala commented 7 years ago

Thanks for the quick reply. But if want pagination functionalities and only need to change the UI lookup of page numbers,what needs to be done.Do i have to write a separate component and write all functionalities instead of {{footer.pagination-numeric}} ?

onechiporenko commented 7 years ago

@SakuDivya, pls create a separated issue. This one is like a "news-board" for 2.x.

GSakunthala commented 7 years ago

I have created.Pls take a look Thank u...

onechiporenko commented 6 years ago

v2.0.0-beta.4 is released. Check small theming guide en / ru

steverhoades commented 6 years ago

Looking really good, thanks for all the hard work @onechiporenko !

onechiporenko commented 6 years ago

v2.0.0 is released.