Cutting value in editor

Cutting value in editor

MarekAdamMarekAdam Posts: 30Questions: 9Answers: 1

Hi
How i can cut value in editor?
Something like this
https://datatables.net/blog/2016-02-26
but for editor.

  editor = new $.fn.dataTable.Editor( {

        ajax: "ajax.php",
        table: "#example",
        fields: [ {
            label: "ID:",
            name:  "table.id"
        }, {

            label: "Name:",
            name:  "table.name"
             type:  "select"
           //  substr his data

}

Can cut in js file or in php Field::inst

Answers

  • allanallan Posts: 61,723Questions: 1Answers: 10,108 Site admin

    Do you mean you want to show the label with ellipsis? Or you actually want to truncate the data that is being saved to the database?

    For the former, if you are using our PHP libraries and the Options class to populate the select list's options, you can use the render option to modify the label that will be shown.

    For the latter, you would use a set formatter.

    Allan

  • MarekAdamMarekAdam Posts: 30Questions: 9Answers: 1

    I have very long names of rekords. When I have to set up references (parent record) in editor by select there is problem bacause input field is too long (select input width is 3 times bigger than the rest). I want to trim this data but only in editor. Data in table are ok bacause there is a line break.

This discussion has been closed.