Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Eirik Brandtzæg
    @eirikb
    (And using paging)
    buzai
    @buzai
    $scope.shoplists = [];
    $scope.shoplists_data = [];
    function getNotVerifyShops() {
      Shop.getNotVerifyShops.query(function(data){
        console.log(data);
    
        $scope.shoplists_data = data;
      })
    }
    getNotVerifyShops()
              <table class="table table-hover" st-table="shoplists" st-safe-src="shoplists_data" >
    i use getNotVerifyShops to get some data
    then repeat in table
    but it not display
    this is because callback?
    Eirik Brandtzæg
    @eirikb
    @buzai Shop.getNOtVerifyShops.query, is that outside of digest loop?
    Does it use $http service, or something else, something non-Angular?
    buzai
    @buzai

    .factory('Shop',['$resource',function($resource){

    var obj={};
    obj=$resource('http://127.0.0.1:8080/api/shops');
    obj.baseinfo=$resource('http://127.0.0.1:8080/api/shops/baseinfo');
    obj.getNotVerifyShops=$resource('http://127.0.0.1:8080/api/shops/getNotVerifyShops',{},{isArray:true});
    obj.getShopByQuery=$resource('http://127.0.0.1:8080/api/shops/getShopByQuery',{},{ isArray:true});
    
    return obj;

    }])

    it is resource
    it return a array
    Eirik Brandtzæg
    @eirikb
    Then it should work
    Have you tried printing some info from the data to your template just to check?
    E.g., <div>Data count: {{shoplist_data.length}}</div>
    buzai
    @buzai
    Data in the load will be displayed, but will soon disappear
    I'm sure the data is there.
    Data count: 0
    oh,no
    But I've already printed it out.
    Eirik Brandtzæg
    @eirikb
    Printed it where?
    buzai
    @buzai
      Shop.getNotVerifyShops.query(function(data){
        console.log(data);
    
        $scope.shoplists_data = data;
        $scope.shoplists = data;
    
      })
    console.log(data);
    console it in controller
    Eirik Brandtzæg
    @eirikb
    I don't think you should set shoplists, just shoplists_data. Leave shoplists as an empty array
    buzai
    @buzai
    ok
    $scope.shoplists = [];
    $scope.shoplists_data = [];
    function getNotVerifyShops() {
      Shop.getNotVerifyShops.query(function(data){
        console.log(data);
    
        $scope.shoplists_data = data;
        // $scope.shoplists = data;
    
      })
    }
    getNotVerifyShops()
        <div>Data count: {{shoplist_data.length}}</div>
              <table class="table table-hover" st-table="shoplists" st-safe-src="shoplists_data" >
                <thead>
                    <tr class="sortable">
                      <th class="table-id" st-sort="shopId" st-sort-default="true">编号</th>
                      <!-- <th st-sort="area">区域</th> -->
                      <th st-sort="company">申请公司</th>
                      <th st-sort="person">联系人</th>
                      <th st-sort="phone">手机号码</th>
                      <th st-sort="state">当前状态</th>
                      <th st-sort="date">最近提交时间</th>
                      <th st-sort="zaozuo">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="item in shoplists_data" class="editable-tr-wrap">
                      <td class="table-id">{{item.shopId}}</td>
                      <!-- <td>{{item.area}}</td> -->
                      <td>{{item.companyName}}</td>
                      <td>{{item.shopApplyUserId.name}}</td>
                      <td>{{item.shopApplyUserId.cellphone}}</td>
              <td>{{test(item.applyId.verify)}}</td>
                      <td>{{spliceTime(item.meta.createAt)}}</td>
                      <!-- <td>{{item.date}}</td> -->
                      <td><a ui-sref="components.check({obj:item._id})">审核</a></td>
    
                    </tr>
                </tbody>
                <tfoot>
                    <tr>
                      <td colspan="8" class="text-center">
                        <div st-pagination="" st-items-by-page="5" st-displayed-pages="5"></div>
                      </td>
                    </tr>
                </tfoot>
              </table>
    Now the data is displayed, but the page, sort is wrong
    Eirik Brandtzæg
    @eirikb
    It's not sorted by shopId?
    buzai
    @buzai
    Now shopId can not be in accordance with the ascending and descending order, and no paging. Direct display of all the data
    The most important thing is tab can not be achieved, the previously used analog data is possible
    I have dozens of data should be displayed on the three, but now are displayed on one page
    Eirik Brandtzæg
    @eirikb
    Your ng-repeat should repeat on shoplists
    buzai
    @buzai
    My God, I'm a fool, and very very grateful to you, my project was the extensive use of this control, if not solve this problem, I will collapse.
    Eirik Brandtzæg
    @eirikb
    I don't think you are a fool, to be honest I think the st-safe-srcis very badly documented on the Smart-Table site. They do however show that st-table should point to "displayed" data, but I don't think there is any mention of what that means and what "displayed" data should be
    buzai
    @buzai
    yes
    Document are based on analog data, I do not quite understand
    akshay-bhasin
    @akshay-bhasin
    Hey all. I am trying to set the model value of a field to null and st-search is attached to it. But in a moment the display shows the old value of the field and not an empty input. Why?
    RS
    @LelouchVlBritannia
    Hello, I am pretty new html/css/java and I am trying to learn how to build a website. Can someone guide me on what I am doing wrong here? https://plnkr.co/edit/CeyQLFzhv7i3UtTLHw4O?p=preview
    Mandeep Singh Gulati
    @mandeepm91
    @LelouchVlBritannia Check out AngularJS documentation on how to create an app and then how to create controller. Also check on how to link them with your HTML view. That should fix it
    read about ng-app and ng-controller
    RS
    @LelouchVlBritannia
    Thanks @mandeepm91. I will check it out
    I got it working on my local machine
    Mandeep Singh Gulati
    @mandeepm91
    great!. Good luck
    RS
    @LelouchVlBritannia
    Thanks :)
    mwithington
    @mwithington

    Hi i have a quick question about the custom pagination docs in angular smart table, it appears that on your site it is currently broken. I did at one point develop a custom pagination like this before

    <nav ng-if="pages.length >= 2">
    <ul class="pagination">
    <li><a ng-click="selectPage(1)">First</a>
    </li><li><a ng-click="selectPage(currentPage - 1)"><</a>
    </li><li><a> {{currentPage}} of {{numPages}}</a>
    </li><li><a ng-click="selectPage(currentPage + 1)">></a>
    </li><li><a ng-click="selectPage(numPages)">Last</a></li>
    </ul>
    </nav>

    Erik Idland
    @eaidland
    Hi! How do I get all items in rowCollection that is "isSelected"?
    getSelectedRows = function() { var selected; return selected = $scope.rowCollection.filter(function(item) { if (item.isSelected === true) { return logger.debug('selected ' + item); } }); };
    Ghost
    @ghost~558d7c6c15522ed4b3e2dbe9
    Is there a way to make sort globally accessible?
    Currently the sorting seems to be case insensitive, but not doesn't work as expected with European accented chars.
    .
    let's say :
    hello, Hello, Hfllo, Hëllo (ë: 0xEB in unicode)
    ideally this is sorted as
    hello
    Hello
    Hëllo
    Hfllo
    .
    Because ë is e, so should come before f, but shown like
    hello
    Hello
    Hfllo
    Hëllo
    Eirik Brandtzæg
    @eirikb
    How does standard JavaScript sort handle the chars?