English 中文(简体)
每当一新栏被点击时,每打一个Qu子就打上 j子。
原标题:make jQuery table sorter sort in ascending order everytime a new column is clicked

我要问,在点击新一栏时,是否有办法每打一栏就打上表格。

感谢!

问题回答

如果你只想按其最初的分类方向分类,就发现和评论这一界限。

this.order = this.count++ % 2;

这是一行,更新了该栏,以在下一点击标题时对面进行分类。 说明这一点意味着,这种命令永远不变。 但这也意味着,你得起反向。

我的情况(可能与你所描述的情况相同)是,我第一次点击,希望每个一栏打上初步方向,但当我再次点击时,仍然希望能够打上另一个方向。 例如,Clicking Column 一种情况是ASC,然后再点击,将使DESC再次陷入困境。 Clicking B将形成ASC,然后再次点击ASC。 原来的表格代码是DESC,因为先前点击的A栏是ASC。

在这方面,我是如何解决的。 它可能是gy和cl,但为我工作。

在建筑主管职能中,发现这一行:

this.order = FormatSortingOrder(支票HeaderOrder(表,指数);

之后添加:

this. initialOrder = FormatSortingOrder(支票HeaderOrder(表,指数);

Replace the line I mentioned earlier:

this.order = this.count++ % 2;

With this:

if($lastColumn == i){
    this.order = ++this.count % 2;
}else{
    this.order = this.initialOrder;
}
$lastColumn = i;

我现在说: ASC和B是DESC。 情况如下:

  1. Click A: Sorts A ASC
  2. Click B: Sorts B DESC
  3. Click B: Sorts B ASC
  4. Click A: Sorts A ASC

页: 1 命令参数:





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签