stwe / DatatablesBundle

This Bundle integrates the jQuery DataTables plugin into your Symfony application.
355 stars 237 forks source link

phoneNumber showing [object Object] into the column #950

Closed davidmorenonuez closed 4 years ago

davidmorenonuez commented 4 years ago

I have this columnbuilder column defined:

->add('phone', Column::class, array(
                    'title' => 'Phone number',
                    'default_content' => '',
                    'visible' => true,
                    'data' => 'phone',
                ))

The entity:

    /**
     * @ORM\Column(name="phone", type="phone_number", length=50, nullable=true)
     * @AssertPhoneNumber(type="any")
     * @AssertUniquePhoneNumber()
     */
    protected $phone = null;

The object is an instance of https://github.com/misd-service-development/phone-number-bundle

When rendering the column, it shows the value [object Object] into the datatable.

What am I doing wrong? Anotación 2020-06-03 155742

Seb33300 commented 4 years ago

Maybe you will need to use a VirtualColumn to display it