Using Editor and mJoin with Responsive Extension is displaying [object Object]
Using Editor and mJoin with Responsive Extension is displaying [object Object]
flowte
Posts: 21Questions: 6Answers: 0
We are using Editor with an mJoin php server side processing and render as per below:
{ data: "company", render: function ( data, type, full ) {
return $.map( data, function ( data, i ) {
if(data == null){return lang['no-company'];}else{return '<span class="view company" id="'+data.id+'">'+data.name+'</span>';}
});
}},
{ data: "company_contact", render: function ( data, type, full ) {
return $.map( data, function ( data, i ) {
if(data.title == null){return lang['no-title'];}else{return data.title;}
});
}},
This is the editor php:
Editor::inst( $db, 'contact' )
->field(
Field::inst( 'contact.id' ),
Field::inst( 'contact.fname' ),
Field::inst( 'contact.lname' ),
Field::inst( 'contact.health' ),
Field::inst( 'contact.subscribed' ),
Field::inst( 'customer.email' )
)
->join(
Mjoin::inst( 'company' )
->link( 'contact.id', 'company_contact.id_contact' )
->link( 'company.id', 'company_contact.id_company' )
->fields(
Field::inst( 'name' ),
Field::inst( 'id' )
)
->where('company.id_venue', $_SESSION['login'][2])
)
->join(
Mjoin::inst( 'tag' )
->link( 'contact.id', 'contact_tag.id_contact' )
->link( 'tag.id', 'contact_tag.id_tag' )
->fields(
Field::inst( 'name' ),
Field::inst( 'id' )
)
)
->join(
Join::inst( 'company_contact' , 'array' )
->join( 'id', 'id_contact' )
->fields(
Field::inst( 'title' )
)
)
->leftJoin('customer', 'customer.id', '=', 'contact.id_customer')
->where('contact.active', 0, '>')
->where('contact.id_venue', $_SESSION['login'][2])
->where( function ( $q ) {
$q->where('contact.id','(SELECT id_contact FROM contact_tag WHERE contact_tag.id_tag IN ('.$_GET['tag'].'))','IN', false);} )
->process($_POST)
->json();
This renders correctly when the columns are displayed full screen but when collapsed (under the responsive plugin) they are being rendered as [object Object]. As per the screen grabs attached (correct / incorrect).
Is there any way to get this to render correctly in the responsive view?
This discussion has been closed.