Load ajax into TabStrip and angularjs

8 posts, 0 answers
  1. Loi
    Loi avatar
    8 posts
    Member since:
    Sep 2014

    Posted 10 Sep 2014 Link to this post

    How to call file html by ajax in Tabstrip when use with angularjs.
    <div kendo-tab-strip k-content-urls="['index.html#/setting/setting-company.tpl.html', null ]">
        <ul>
            <li class="k-state-active">First tab</li>
            <li>Second tab</li>
        </ul>
    </div>

    I got error the file not found
  2. Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 12 Sep 2014 Link to this post

    Hello Loi,

    Loading the content via Ajax seems to be working correctly at least on my side. Could you check this example and let me know if I am missing something?

    Regards,
    Daniel
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Loi
    Loi avatar
    8 posts
    Member since:
    Sep 2014

    Posted 16 Sep 2014 in reply to Daniel Link to this post

    Hi Daniel,
    I still got the error.Look my screen short.If I used ng-include the file,It word very well.

    Thanks,
    Loi Tran
  5. Loi
    Loi avatar
    8 posts
    Member since:
    Sep 2014

    Posted 16 Sep 2014 in reply to Daniel Link to this post

    Daniel,
    I used https://github.com/angular-ui/ui-router maybe this is problem.Do you have any advices for the error?

    Thanks
  6. Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 18 Sep 2014 Link to this post

    Hello again,

    If the content is loaded when using ng-include then could you check if there are any differences in the requests? I am not sure how would the router prevent the tabstrip from making a correct request.

    Regards,
    Daniel
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  7. Rajesh
    Rajesh avatar
    53 posts
    Member since:
    Jan 2014

    Posted 21 Jan 2015 in reply to Daniel Link to this post

    I am trying to dynamically generate a kendo tab strip and its content via an angularjJS $resource calls. My ajax calls are authenticated and require setting a customer http header and I hence cannot rely on the contentUrl field.

    <div kendo-window="viewlogWindowAlt" k-title="'View Logs'" k-width="1100" k-height="200"
                             k-visible="false"
                             k-on-open="retrieveDeviceLogs()"
                             k-position="{left:'125px'}">
    <div kendo-tab-strip="deviceMetadata.viewLogTabStrip" k-data-content-field="content">
     </div>
    </div>

    $scope.retrieveDeviceLogs = function() {
            //Retrieve list of logs from appmgr backend
            appMgrRESTService.deviceLogsRESTService.query({deviceId: $scope.device.deviceId},
                function(result){
                    $scope.deviceMetadata.viewLogTabStrip.dataSource.data([]);

                    var promises = [];
                    angular.forEach(result, function(log){
                        promises.push(retrieveDeviceLogByFilename(log));
                    });
                    $q.all(promises).then(function(response){
                        angular.forEach(result, function(log){
                            $scope.deviceMetadata.viewLogTabStrip.append({ text: log.filename, content : log.content});
                        });
                        if (result.length >= 1){
                            $scope.deviceMetadata.viewLogTabStrip.select(1);
                        }
                    });

                },
                function(error){
                    $log.fatal("Could not retrive caf logs for device with id: " + $scope.device.deviceId);
                });
        };

    retrieveDeviceLogByFilename sets the content of the log into log.content.

    What should I be doing to see my content in each of the tabs ? I only see the tab text but do not see the contents of each tab.



  8. Rajesh
    Rajesh avatar
    53 posts
    Member since:
    Jan 2014

    Posted 21 Jan 2015 in reply to Rajesh Link to this post

    Just realized it was my mistake is setting the right content. http://dojo.telerik.com/@rtv/AnOju/3 in case it is of help to others.

    How do I get the content display to honour line breaks in the text ? It shows it all in one line currently.

    -Rajesh
  9. Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 23 Jan 2015 Link to this post

    Hello Rajesh,

    You should use HTML elements like <br> to split the text into multiple lines.

    Regards,
    Daniel
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready