Select2 Tags issue

QuestionsSelect2 Tags issue
Gaëtan asked 8 years ago

Hi Abu,
I am trying to implement to select2 Tags object.
It sort of works, but not quite fully.

Here is the code:
http://pastebin.com/ziZvbRZb

Here are the screen shots:
https://www.dropbox.com/sh/rm7rn665jegpifx/AACVqE-hRiJ-RCvRNF5935TSa?dl=0

1- First of all, in the "From" column, I would like the country name shown, not their ID.
I have tried to change the sql line 38 by adding "INNER JOIN crm_country cf ON cf.country_id = m.main_countries_from" at the end and "cf.local_name as main_countries_from" at the beginning of the statement, but it then only shown the records with a "From" country value, not the other ones.

2- Secondly, when using the search filter, it only works when a single country in saved in the "From" column… If there are more than one, then the filtering reports nothing.

I can provide you by email a link to the dev project so you can txt by yourself.

Thanks

7 Answers
Abu Ghufran answered 8 years ago

I'll regenerate same scenario and update you the solution.

Abu Ghufran answered 8 years ago

Hello,

Sorry for the delayed reply.
The issue could be due to exact search (=) while using dropdown.

If you try contains search with that field, it should result all matching data.
With that column, you can try adding:

$col["searchoptions"]["sopt"] = array("cn");

Abu Ghufran answered 8 years ago

Plus, to see country names instead of numeric ids, you can set:
$col["formatter"] = "select";

Gaëtan answered 8 years ago

Hi Abu,
Thanks for this.
It almost work.
When editing a record with one or more countries, it shows "undefined" in the corresponding field.

Gaëtan

Abu Ghufran answered 8 years ago

Emailed you an update.

Gaëtan answered 8 years ago

Sorry Abu, still the same issue.

Abu Ghufran answered 8 years ago

Emailed complete files again. Recheck after update.

Your Answer

6 + 4 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?