0

I have the following code:

if (object.GroupBy == "Cities")
    $("body").children().find("td:first[name=Name]>").html("City");
if (object.GroupBy == "Banks")
    $("body").children().find("td:first[name=Name]>").html("Banks");
if (object.GroupBy == "User")
    $("body").children().find("td:first[name=Name]").html("Users"); 

<tr class="form-list-table-header">
    <td class="" name="Name"></td>
    <td class="" name="Total">Total</td>
</tr>

<div><span>Group By</span></div>
    <select class="combobox" name="GroupBy">
          <option value="Cities">Cities</option>
          <option value="Banks">Banks</option>
          <option value="Users">Users</option>
    </select>
</div>

If the user select Cities, the td is not with the selected option. For example, in the combobox is selected the cities value.
So, in the header of the table will appear:

| Cities | Total |

1
Contributor
1
Reply
4
Views
2 Years
Discussion Span
Last Post by jean_5
0

I made it and have worked

if (object.GroupBy == "City")
    $('.change:first').html('City');
if (object.GroupBy == "Banks")
    $('.change:first').html('Banks');
if (object.GroupBy == "Users")
    $('.change:first').html('Users');

<select class="combobox" name="GroupBy">
    <option value="City">City</option>
    <option value="Banks">Banks</option>
    <option value="Users">Users</option>
</select>

<table class="form-list-table" width="100%">
    <tr class="form-list-table-header">
         <td class="change" name="Name"></td>
         <td class="" name="Total">Inclusões</td>
    </tr>
</table>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.