Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page contains the current in-house Trenz Electronic Shop articles and their most important features to compare and/ or search for the suitable articles.

To find the desired articles you can either use the search filter which reduces the table content and/or you can use the sorting function of the table itself.

HTML
<form class="aui">
    <div class="field-group">
        <label for="searchInput_mytable">Table Filter:</label>
        <input class="text $paramClass" type="text" id="searchInput_mytable">
        <div class="description">To reduce the table please enter substring. e.g. series name or other name or properies</div>
    </div>
</form>
<script type="text/javascript">
	var column_number = -1;
    AJS.$("#searchInput_mytable").keyup(function () {
        var jqry = AJS.$
        var rows = jqry("#tableFilter_mytable tbody tr").hide();
        var searchData = this.value;
        if (searchData.length) {
                var data = searchData.toLowerCase().split(" ");
                jqry.each(data, function (search_idx, str) {
                rows.filter(function(row) {
                    var col_to_filter = column_number;
                    if (col_to_filter>=0) {
                        var td_to_filter = $(this).children("td").eq(parseInt(col_to_filter));
                        return $(td_to_filter).text().toLowerCase().indexOf(data) >= 0;
                    } else {
                        return $(this).text().toLowerCase().indexOf(data) >= 0;
                    }
                }).show();
                });
        } else {
            rows.show();
        }
    });
</script>

...