Rusheel Jain
Rusheel Jain

Reputation: 843

How to set column toggle default text

I want to set the default text of column-toggle in jquery mobile.

This should happen through code and not in the html.

I tried this:

$(document)
    .ready( function() {
         $("#myTableID").prop("data-column-btn-text","asd");
     }
)

Upvotes: 0

Views: 36

Answers (1)

ezanker
ezanker

Reputation: 24738

Instead of $(document).ready(... use the jQM pagecreate event. Thenyou can just set the text of the button directly using its class (.ui-table-columntoggle-btn):

$(document).on("pagecreate", "#page1", function () {

    $(".ui-table-columntoggle-btn").text("asd");

});

Upvotes: 1

Related Questions