angularjs smart table (st-table) issue with ngInclude

73 views Asked by At

I had a page working fine with st-table in angularjs (1.8.x). Ref: Smart Table Website or on Git Hub. Because the page was becoming too big (HTML), as a quick fix I put the sections into diff HTML files and then used ng-include on main page. But since then the st-search stopped working.

Check the code:

<table class="table table-condense table-striped table-bordered" ng-hide="vmModelMg.currentModel.exclusionParts.length==0" st-safe-src="vmModelMg.currentModel.exclusionParts" st-table="dispExclPartsList">
  <thead style="overflow-y:scroll;">
    <tr>
      <th colspan="2" style="width: 30%; padding-right: 10px;border-right:none;">
        <a class="btn btn-primary pull-left" ng-click="vmModelMg.refreshExclusionPartsManual()">Refresh</a>
      </th>
      <th colspan="3" style="width: 35%;border-right:none;border-left:none;">
        Show only Active? :
        <!--'{{vmModelMg.isActiveModelFilterExPt}}'-->
        <input type="checkbox" st-search="isActive" value="{{vmModelMg.isActiveModelFilterExPt}}" ng-model="vmModelMg.isActiveModelFilterExPt" ng-true-value="true" ng-false-value="" />
      </th>
      <th style="width: 35%;border-left:none;">
        <a class="btn btn-primary pull-right" ng-click="vmModelMg.addNewExclusionPart()">Add new Exclusion Part</a>
      </th>
    </tr>
    <tr>
      <th style="width: 10%;"></th>
      <th st-sort="partCode" style="width: 15%;">Part Code</th>
      <th style="width: 15%;">Transmission Type</th>
      <th st-sort="isActive" style="width: 15%;">Is Active?</th>
      <th style="width: 45%;">Notes</th>
    </tr>
  </thead>
  <tbody style="overflow-y:scroll;max-height:300px;">
    <tr ng-show="dispExclPartsList.length==0">
      <td colspan="5" style="width:100%;">
        <div class="alert alert-info">
          No Exclusion Parts found.
        </div>
      </td>
    </tr>
    <tr ng-repeat="exclPartRec in dispExclPartsList">
      ... td values here ...
    </tr>
  </tbody>
</table>

I included this using code below:

<ng-include src="'/Scripts/app/Views/manageModels.exclusionParts.html'"></ng-include>

Can someone please advise why if I paste this code in main page it works & if in the ngInclude it doesn't. Now, when I say it doesn't it doesn't show records when tab is loaded. If I click on "Show Active only" checkbox, the filter starts working. But, if same code is on single page, it shows records as soon as I load the tab.

0

There are 0 answers