Is there a way to do pre-order

Is there a way to do pre-order

jyoujyou Posts: 3Questions: 1Answers: 0

Hi,
By checking the https://datatables.net/reference/event/, we can see 'order' event which will be 'fired when the data contained in the table is ordered.' But what I want to do is that if a condition matches then do sorting, otherwise stop sorting.

Is there a way to do it?

Thanks for your help.

Answers

  • colincolin Posts: 15,144Questions: 1Answers: 2,586

    Hi @jyou ,

    No, that's not possible, I'm afraid - the order isn't cancellable. What you could do though, is redefine the order, as I did in this example here. There, I disabled the original ordering, and created my own on the same header cells - this should work for you.

    Cheers,

    Colin

  • jyoujyou Posts: 3Questions: 1Answers: 0

    Got it. Thanks Colin.

This discussion has been closed.