Kyslik / column-sortable

Package for handling column sorting in Laravel 5/6/7/8
MIT License
644 stars 105 forks source link

Don't display Japanese Title. #138

Closed bluestar0505 closed 4 years ago

bluestar0505 commented 4 years ago

@sortablelink('category', 'Category') It is working. @sortablelink('category', "大カテゴリ名") It is displaying empty.

sovoeun commented 4 years ago

Hi daranyK, I'm also facing this issue did you already resolved it please tell the solution.

Thanks

bluestar0505 commented 4 years ago

Do you use jquery?

<th data-title="大カテゴリ名">@sortablelink('category', '')</th>

 $( "th" ).each(function() {
      title = $(this).data('title');
      if (title) {
           $(this).children("a").text(title);
       }
 });
lijunjin418 commented 4 years ago

try to change text with first space like this. @sortablelink('category', " 大カテゴリ名")

bluestar0505 commented 4 years ago

Hi KingProgrammerOne, It is working. Thanks .

umar-ashrfy commented 3 years ago

Another solution I found working is, if we change

Line#100 on vendor/kyslik/column-sortable/src/ColumnSortable/SortableLink.php

$title = call_user_func($formatting_function, $title); ↓ if(!preg_match("/^[ぁ-んァ-ヶー一-龠]+$/u",$title)) $title = call_user_func($formatting_function, $title);

Should I raise a PR for this?

Yair-Htut-Khaung-SCM commented 1 year ago

try to change text with first space like this. @sortablelink('category', " 大カテゴリ名")

work like a magic