0

在 jqGrid ColumnChooser 上的 Add Remove Column Handler看到了这个链接。

我想知道如何使用这种 JQuery 语法循环遍历 <li></li> 列表以获取显示文本...

    $("#colchooser_" + $.jgrid.jqID(this.id) + " ul.selected")
        //.bind("sortreceive", function (event, ui) {
        //    alert('column "' + ui.item.text() + '" is choosed');
        //});

谢谢...

4

1 回答 1

1

.each()

http://api.jquery.com/each/

var id = $.jgrid.jqID(this.id);

$("#colchooser_" + id + " ul.selected li").each(function() {
  console.log( $(this).text() );
});

这将注销每个<li>的显示文本的内容。

于 2013-09-07T00:12:36.223 回答