Tabular.Table make filter to collection


#1

I want give not all data, only data where we have field subFrom. I use selector

	selector: () ->
	{
		subTo: { $exist : true }
	}

but it dont change any data

AdminTables.Subscribers = new Tabular.Table
changeSelector: (selector, userId) ->
	$or = selector['$or']
	$or and selector['$or'] = _.map $or, (exp) ->
		if exp.emails?['$regex']?
			emails: $elemMatch: address: exp.emails
		else
			exp
	selector

name: 'Subscribers'
collection: Meteor.users
columns: _.union [
	{
		data: 'emails'
		title: 'Email'
		render: (value) ->
			value[0].address
		searchable: true
	}
	{
		data: 'emails'
		title: 'Mail'
		createdCell: (node, cellData, rowData) ->
			$(node).html(Blaze.toHTMLWithData Template.adminUsersMailBtn, {emails: cellData}, node)
		width: '40px'
	}
	{ data: 'profile.subFrom', title: 'Subscribe from:', class: 'sub' }
	{ data: 'profile.subTo', title: 'Subscribe to:' }
selector: () ->
	{
		subTo: { $exist : true }
	}

]
dom: adminTablesDom