There are quite a few similar issues on here, but none of those solutions seem to work. I have a table where the content is dynamically loaded in via some voodoo, and I want to take the first 4 characters from the first <td>
of each row off. The row has a classname of "task-name".
<tbody class="row maintask" ng-repeat="task in job.Tasks">
<tr class="task-name">
<td class="col-sm-7">{{task.TaskName}}</td>
<td class="col-sm-4 col-sm-offset-1">{{task.TaskStatusStageDisplay}} <span ng-show="{{task.IsFailed}}||{{task.HasWarnings}}"><a href="{{task.StatusActionUrl}}" class="btn btn-sm btn-default pull-right" target="_Blank"> Errors</a></span>
</td>
</tr>
<tr class="subtask1 task-name" ng-repeat-start="subtask in task.SubJobTasks" ng-include="'tree_item.html'"></tr>
I've tried:
var text = '.task-name'.substring(4);
and
$('.task-name').substring(4);
as well as a few other variations, including using substr
and slice
. I've also tried it on other elements on the page to see if the table was the issue, but that hasn't worked either. Any ideas? Cheers.
I've just tried everyone's suggestions so far and nothing's working, even if I try different classes, buuuuut.... I didn't say that this was happening in a modal, when I tried it on elements not in the modal it worked! Really wouldn't expect a modal to affect it though, unless it's more to do with how the table gets populated, but that stuff goes over my head.