keep large text field contained in normal size row

keep large text field contained in normal size row

drrakkendrrakken Posts: 2Questions: 0Answers: 0
edited February 2014 in General
I have a column from my SQL query that has a large volume of text that I would like to display just enough of to maintain the height of the row as a single normal row. I don't need to see the whole content of the text. Some way to trim to a single line?

thanks

Replies

  • HayezbHayezb Posts: 10Questions: 1Answers: 0
    Was about to ask the same questions! Hopefully someone can help out, I've tried a couple different "solutions" but can't seem to get what I'm looking for.
  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    edited February 2014
    How are you retrieving the data? The usual point at which to do this would be between retrieval and display - php's string functions for example.
  • HayezbHayezb Posts: 10Questions: 1Answers: 0
    Here is my view:

    [code]

    $(document).ready(function() {
    $('#notestable').dataTable( {
    "sPaginationType": "bs_normal",
    "bProcessing": true,
    "bServerSide": true,
    "sAjaxSource": "<?php echo base_url('administration/vendors/tableload_location_notes/'.$locationId)?>",
    "sServerMethod": "POST",
    "aoColumnDefs": { "bVisible": false, "aTargets": [0]},
    } );
    } );





    Id
    Added By
    Date
    Notes





    Loading data from server



    [/code]

    Here is my controller:

    [code]
    public function tableload_location_notes()
    {

    $this->load->database();
    $this->load->library('Datatables');
    $this->datatables->select('
    VENDORLOCATIONNOTES.ID,
    VENDORLOCATIONNOTES.ADDEDBY,
    VENDORLOCATIONNOTES.DATEADDED,
    VENDORLOCATIONNOTES.NOTES
    ', FALSE);
    $this->datatables->from('VENDORLOCATIONNOTES');
    $this->datatables->where('VENDORLOCATIONNOTES.LOCATIONID', $this->uri->segment(4));
    $this->datatables->add_column('edit', 'view', 'ID');

    echo $this->datatables->generate();

    }
    [/code]
  • drrakkendrrakken Posts: 2Questions: 0Answers: 0
    Well I'm retrieving it from a Coldfusion query. I suppose I could use the RemoveChars() function along with the Len() function and go from there. I just thought there would be an cleaner, easier way.
  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    You could use mRender and `substr` in Javascript which is what I've done before.

    Allan
This discussion has been closed.