cnizzardini / cakephp-datatable

CakePHP Component for interoperability between CakePHP 2.x and jQuery DataTables plugin.
62 stars 47 forks source link

Plans to extend the plugin for custom find #37

Open fr0z3nfyr opened 7 years ago

fr0z3nfyr commented 7 years ago

Any plans to extend the plugin to perform custom find (all, threaded, <custom>,...) instead of supporting just the Paginator component?

I'm right now facing this challenge to find records using threaded and display them as a tree in DT. So, I really can't use paginate for this purpose.

  1. I want to avoid processing the data in my view
  2. I don't want to complicate my paginator settings (it might not be possible at all, haven't tried yet)
  3. Want to control whether to count child rows in iTotalRecords and iDisplayRecords
  4. ...

I may end up extending the functionality of your plugin, just wanted to check your thoughts on this and if you had any plans.

cnizzardini commented 7 years ago

I've started a new project for Cake3 (https://github.com/cnizzardini/cakephp-yummy). I have yet to port this code over though. It is not likely I will continue to maintain this for Cake2...sorry :-(

cnizzardini commented 7 years ago

Out of curiosity, how were you going to display threaded in a table view? Not sure DT is the best for this. If you want to extend and can demonstrate your changes work, I'd be happy to merge them into master.

There are all good ideas for the next version in cakephp-yummy as well. Are you pretty much stuck on Cake2?

fr0z3nfyr commented 7 years ago

I did chech Cake-Yummy and liked it from the literature(never used, though).

Are you pretty much stuck on Cake2?

Sadly, yes!! Have no choice at the moment because 3 apps written on cake 2 use single sign-on by sharing sessions. I will probably migrate all the apps to Cake 3 someday and get rid of session sharing altogether (there are pretty decent ways to achieve this, I know!).

Out of curiosity, how were you going to display threaded in a table view?

Well, I started by following a post on their support forum and realized it doesn't work right. Then I started to write an extension for DT of my own, and came across this extension. Well, it's not robust yet but at least gets the work done for now.

fr0z3nfyr commented 7 years ago

Ohh! I forgot to mention that I tried to use paginate by setting 'findType' => 'threaded' in $this->Paginator->settings but unfortunately, the retrieved data was not formatted as find('threaded') with children sub array. So, one thing is clear that I can't use paginate for this table.

I'm thinking of reconsidering my choice of using DT for this table like you suggested, but I'd prefer keeping the visual appeal of all my tables same and I'm not very good with CSS. :cry: Let's see how this one turns out in the end!

Should I close this issue, or you want to keep this open to plan something for Cake 3?

cnizzardini commented 7 years ago

Nah it can stay open