How can i search all the meta data

How can i search all the meta data

Aryan1703Aryan1703 Posts: 77Questions: 20Answers: 1

I am formattign all the values in one and sending them as a html content. I have a search for this but it does not search the meta data(all the fields that I have included) except the original value itself(Ol.comment) on the client side. How can i make it to search everything


$('input', this.footer()).on('keyup change', function () { if (that.searchTimer) { clearTimeout(that.searchTimer); } if (that.search() !== this.value) { that .search(this.value) .draw(); } });``` ```php Field::inst('OL.comment', 'comment') ->getFormatter(function ($val, $data, $field) { $details = [ ['key' => 'U1.username', 'label' => 'Operator'], ['key' => 'OM.Mode', 'label' => 'Mode'], ['key' => 'EB.EB', 'label' => 'EB Type'], ['key' => 'OL.speed', 'label' => 'Speed'], ['key' => 'Y2.yesNo', 'label' => 'Flats'], ['key' => 'OL.oscRating', 'label' => 'Rating'], ['key' => 'OL.vatc', 'label' => 'VATC Reboot'], ['key' => 'Y3.yesNo', 'label' => 'Braking/Propulsion'], ['key' => 'Y1.yesNo', 'label' => 'Out of Service'], ['key' => 'OL.dos', 'label' => 'Door Operations Switch'], ['key' => 'Y4.yesNo', 'label' => 'Are you Properly Berthed?'], ['key' => 'OL.qfmID', 'label' => 'QFM #'], ['key' => 'U4.username', 'label' => 'Other Operators'] ]; $comment = $val; // Starting with the original comment value $commentReturn = ''; foreach ($details as $detail) { if (isset ($data[$detail['key']]) && !empty ($data[$detail['key']])) { $value = $data[$detail['key']]; $label = $detail['label']; if ($label == "Door Operations Switch") { if ($value == 1) { $value = "Manual"; } else { $value = "Auto"; } } $commentReturn .= '<br> [' . $label . ': ' . $value . '] '; } }

Answers

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Are you using server-side processing? If so, the search is done in SQL so any formatting added in PHP wouldn't be searchable.

    Can you link to the page showing the issue so I can understand the issue a little more?

    Thanks,
    Allan

  • Aryan1703Aryan1703 Posts: 77Questions: 20Answers: 1
    edited November 18

    Hello Allan,

    Yes, I am using server-side processing.

    this is the site page "https://stagingc.assettrack.cx/operations/DailyLog.php". Check for the column description

    I already sent you the credential before in DM.

    THanks

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Hi,

    Thanks for reminding me! Good to hear from you again.

    I'm currently getting:

    We received 1 login or password reset attempts from your client, it will be blocked from logging in for 60 minutes after 5 attempts

    When attempting to login (the number doesn't increase if I try to login again).

    That said, if the issue is that you can't search for Manual or Auto, then that is because of the text resolving in PHP. As I say, the search is performed in SQL, so by the time the PHP renderers run, it is already too late.

    One way to resolve this is with an SQL VIEW that will resolve the text formatting logic for you, or if it is possible to do it in the SQL SELECT statement with some logic, then we might be able to use that, but it isn't clear to me that is the case.

    Allan

  • Aryan1703Aryan1703 Posts: 77Questions: 20Answers: 1
    edited November 19

    username: [retracted]
    pass: [retracted]

    The issue is not with the Manual or Auto instead searching the values that are rendered.

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Do you mean things like:

    ['key' => 'U1.username', 'label' => 'Operator'],
    

    ?

    If so, then that is the same issue. The search is being done before the rendering action.

    Is this an editable table? If not, then I'd suggest doing the formatting logic in an SQL VIEW, and direct the Editor PHP instance to read from that VIEW.

    Allan

  • Aryan1703Aryan1703 Posts: 77Questions: 20Answers: 1

    Yes, the table is an editable one. With keeping the formatting like this and not use a view where/how can i change the sql statement to change the search logic for this column.

    Thanks

Sign In or Register to comment.