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

Filtering media list #230

Open
mhamlet opened this issue Mar 24, 2014 · 2 comments
Open

Filtering media list #230

mhamlet opened this issue Mar 24, 2014 · 2 comments

Comments

@mhamlet
Copy link

mhamlet commented Mar 24, 2014

I'm customizing the Caspa. Now I have a question.

I want to filter media list by field in database. I have, for example, field1 in Medias collection, and I want to get and show in media list only medias that have field1=value1.

I tried to change 35rd line in medialist.js file with this, but that's not working for me:

collection.fetch({
    data: $.param({
        'field1': 'value1'
    })
});

How can I do it?

@pardo-bsso
Copy link
Member

Hi mhamlet,

we have a custom backend for filtering. Currently what we do is to call collection.setQuery( query, page_size) and then do a .fetch().

The relevant files are:
https://github.com/inaes-tic/mbc-caspa/blob/master/public/js/views/mediasearch.js#L108
https://github.com/inaes-tic/mbc-common/blob/master/models/Default.js#L46
https://github.com/inaes-tic/mbc-common/blob/master/models/searchWrapper.js

@xaiki
Copy link
Member

xaiki commented Mar 25, 2014

furthermore we're really excited on seeing what you're doing ! is there
a public repo we can check your code at ?

cheers,

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