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

Is there any way to use containable behavior ? #71

Open
nitish-mca opened this issue Mar 11, 2016 · 4 comments
Open

Is there any way to use containable behavior ? #71

nitish-mca opened this issue Mar 11, 2016 · 4 comments

Comments

@nitish-mca
Copy link

Hi,
Is there anyway to use containable behavior in datatable query ?

@tigrang
Copy link
Owner

tigrang commented Mar 11, 2016

Yes, just add the contain key to the configuration in the component. Depending on the type of relation you may not be able to sort on the associated columns (a second query may be used where a join is needed). You'll need to force a join using joins or re-binding the association in a different way.

@vermarenu
Copy link

Hi,
According to above suggestion i added code like :
'contain' => array('table name'),'joins' => array(
array(
'table' => 'table name',
'alias' => 'table alias',
'foreignKey' => false,
'conditions' => [],
'type' => 'inner',
),
),

rule for this "table name" is not define in that particular model.
but nothing happen. please correct where i am wrong ? is this necessary to define rule in model ?
Also if i want to bind/unbind model for this plug-in then where to write code.

@nitish-mca
Copy link
Author

I couldn't find the way for fetch data with recursive level 2. I had tried contain as well as join queries. I also try it with setting recursive 2

@tigrang
Copy link
Owner

tigrang commented Mar 15, 2016

@nitish-mca can you share some code. Also, take a look at http://mark-story.com/posts/view/using-bindmodel-to-get-to-deep-relations

If you can get the queries that are generated that would help. Thanks.

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

3 participants