Jump to content


ajax sorting is not natural sorting

natural sort ajax flexigrid

  • Please log in to reply
3 replies to this topic

#1 Ji Jia Jia

Ji Jia Jia

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 09 April 2013 - 03:01 PM

Hello,

 

I have a question, why my flexigrid ajax sorting is not sorting in natural sort?

Where can i modify it? 

 

 

 

JJ



#2 davidoster

davidoster

    Grocery CRUD Ninja

  • Advanced Member
  • PipPipPip
  • 1,068 posts
  • LocationAthens, Greece

Posted 09 April 2013 - 10:45 PM

Can you give us an example what you mean?


____________________________________________________________

 

rtfm_small.jpg---!!!Please read these guidelines before asking to the forums!!!---

____________________________________________________________

 

David Oster aka George Pasparakis,
http://odphotography.com
http://eletter.gr


#3 Ji Jia Jia

Ji Jia Jia

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 10 April 2013 - 11:12 AM

Actually is like

http://13h.imghost.u...reenShot002.jpg

But i would like to be

http://13h.imghost.u...reenShot001.jpg

 

I think it's a matter of the natural sort, and i might tell that it's an relation field

 

 

$crud->display_as('tipo_q','Type')
        ->display_as('livello_q','Level')
        ->display_as('skin_q','Skin')
        ;

 

$crud->set_relation('livello_q','livelli','Level {livello_id} <span\nstyle="font-weight:bold;color:{livello_colore};">{livello_nome} {livello_num}</span>',null,'livello_id ASC');



#4 davidoster

davidoster

    Grocery CRUD Ninja

  • Advanced Member
  • PipPipPip
  • 1,068 posts
  • LocationAthens, Greece

Posted 10 April 2013 - 10:00 PM

On strange cases, like this one, because set_relation might not be enough to display the data, at least my viewpoint is, to do a manual kind of set relation.

In other words via a model get the data in demand, then within controller alter the data array they way I need to and lastly use the field_type to pass the new data for the field.

 

Otherwise you need to define a sorting field, kind of weight and sort using this field.


Edited by davidoster, 10 April 2013 - 10:01 PM.

____________________________________________________________

 

rtfm_small.jpg---!!!Please read these guidelines before asking to the forums!!!---

____________________________________________________________

 

David Oster aka George Pasparakis,
http://odphotography.com
http://eletter.gr






Also tagged with one or more of these keywords: natural, sort, ajax, flexigrid

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users