searching not working when merged two columns with serverside true.

searching not working when merged two columns with serverside true.

mawais2080mawais2080 Posts: 5Questions: 2Answers: 0
edited May 2019 in Free community support
            {
              title: 'Name',
              data: 'full_name', // what should i place here 
              render: function (data, type, row) {
                 if (type === 'display') {
                    return row.first_name + ' ' + row.last_name;
                 }
              },
              defaultContent: '',
              orderable: true,
              searchable: true
           },            

Answers

  • mawais2080mawais2080 Posts: 5Questions: 2Answers: 0

    when i place first_name in place of full_name it only searches with first name not with last name. what possible solution can be i will be very much thankful.

  • colincolin Posts: 15,144Questions: 1Answers: 2,586

    Hi @mawais2080 ,

    As there's no data source for that line,

     data: 'full_name', // what should i place here
    

    just use

    data: null,
    

    Cheers,

    Colin

  • mawais2080mawais2080 Posts: 5Questions: 2Answers: 0
    edited May 2019

    @colin when i did that i get no record and when looking at network i see this error

    Exception Message:↵↵SQLSTATE[42S22]: Column not found: 1054 Unknown column 'members.' in 'where clause' (SQL: select count(*) as aggregate from (select '1' as row_count from members where members.organization_id = 15554 and members.organization_id is not null and (LOWER(members.member_id) LIKE %mike% or LOWER(members.``) LIKE %mike% or LOWER(members.contact_no) LIKE %mike% or LOWER(members.date_of_birth) LIKE %mike%)) count_row_table)"

  • colincolin Posts: 15,144Questions: 1Answers: 2,586

    The error is saying members is an unknown column, but that wasn't mentioned in your earlier posts - could you post your client and server side code, please.

  • mawais2080mawais2080 Posts: 5Questions: 2Answers: 0

    @colin its resolved thanks :)

This discussion has been closed.