Browse Source

Hi,

You can send me a pull request, and if the feature is good I will consider to merge it to the develop version. Thanks.

https://github.com/wenzhixin/bootstrap-table/pulls

--
Best regards,
Zhixin Wen
China

2015-02-26 21:14 GMT+08:00 Yuanyan Wu <ywu999@hotmail.com>:
Hi, Wen Zhi Xin,
 
Your script was very helpful for me. I found out an extra feature that could be added into it. Basically I wanted to sort a column with a customizable sort-name, not the default sort-name in the header, or the field of the column. This feature is very useful for the following scenario:
 
I have a column field “name” with the value of abc, but I want to display in html (field name: htmlName) as “<b><span style=”color:red”>abc</span></b>”. I really want to sort the column use the field “name” instead of “htmlName”.
 
If you are willing, I can commit my changes to your project.
 
Thanks,
 
Yuanyan Wu
Yuanyan Wu 11 years ago
parent
commit
e6292653fa

+ 10 - 0
docs/_i18n/en/documentation/column-options.md

@@ -179,6 +179,16 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
         </td>
     </tr>
     <tr>
+        <td>sort-name</td>
+        <td>data-sort-name</td>
+        <td>String</td>
+        <td>undefined</td>
+        <td>Provide a customizable sort-name, not the default sort-name in the header, or the field name
+        of the column. For example, a column might display the value of fieldName of "html" such as  
+        "<b><span style="color:red">abc</span></b>", but a fieldName to sort is "content" with the value of "abc".
+        </td>
+    </tr>    
+    <tr>
         <td>cellStyle</td>
         <td>data-cell-style</td>
         <td>Function</td>

+ 10 - 0
docs/_i18n/es/documentation/column-options.md

@@ -176,6 +176,16 @@ Las propiedades de la columna están definidas en `jQuery.fn.bootstrapTable.colu
         b: el segundo valor del campo.</td>
     </tr>
     <tr>
+        <td>sort-name</td>
+        <td>data-sort-name</td>
+        <td>String</td>
+        <td>undefined</td>
+        <td>Proporcionar una especie-nombre adaptable, no la clase-nombre por defecto en la cabecera, o el nombre del campo
+         de la columna. Por ejemplo, una columna puede mostrar el valor de nombreCampo de "HTML" como
+         "<b><span style="color:red">abc</span></b>", pero una nombreCampo para ordenar es el "contenido" con el valor de "abc".
+        </td>
+    </tr>    
+    <tr>
         <td>cellStyle</td>
         <td>data-cell-style</td>
         <td>Function</td>

+ 10 - 0
docs/_i18n/fr/documentation/column-options.md

@@ -154,6 +154,16 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
         </td>
     </tr>
     <tr>
+        <td>sort-name</td>
+        <td>data-sort-name</td>
+        <td>String</td>
+        <td>undefined</td>
+        <td>Fournir une sorte nom personnalisable, pas le genre-nom par défaut dans l'en-tête, ou le nom de domaine
+         de la colonne. Par exemple, une colonne peut afficher la valeur de nomChamp de "html" tel que
+         "<b><span style="color:red">abc</span></b>", mais le nom du champ pour trier est "contenu" à la valeur de "abc".
+        </td>
+    </tr>
+    <tr>
         <td>cellStyle</td>
         <td>data-cell-style</td>
         <td>Function</td>

+ 10 - 0
docs/_i18n/zh-cn/documentation/column-options.md

@@ -154,6 +154,16 @@ The column options is defined in `jQuery.fn.bootstrapTable.columnDefaults`.
         </td>
     </tr>
     <tr>
+        <td>sort-name</td>
+        <td>data-sort-name</td>
+        <td>String</td>
+        <td>undefined</td>
+        <td>Provide a customizable sort-name, not the default sort-name in the header, or the field name
+        of the column. For example, a column might display the value of fieldName of "html" such as  
+        "<b><span style="color:red">abc</span></b>", but a fieldName to sort is "content" with the value of "abc".
+        </td>
+    </tr>    
+    <tr>
         <td>cellStyle</td>
         <td>data-cell-style</td>
         <td>Function</td>