0

I saw this link at Add Remove Column Handler on jqGrid ColumnChooser .

I wonder how to use this JQuery syntax to loop through the < li >< /li > list to get the display text...

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

Thanks...

Community
  • 1
  • 1
fletchsod
  • 3,560
  • 7
  • 39
  • 65

1 Answers1

1

.each()

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

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

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

That would log out the content of each <li>'s display text.

nackjicholson
  • 4,557
  • 4
  • 37
  • 35