Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Angular question
Message
General information
Forum:
Javascript
Category:
Other
Miscellaneous
Thread ID:
01601977
Message ID:
01602041
Views:
44
>It's pulling the description from your table.columns collection (which is probably set in your Angular controller (so from a JS file), something like $scope.table where table contains an array named "columns"). So you'd need to set it there. Look for the ng-controller (or data-ng-controller) directive on the page. It will tell you which controller to look in.

Hi Paul,

I would need some generic solution here, but I already have question with your approach. In the index.cshtml view for the page I see the following code
<div ng-controller="templatesController">
    <div sm-search-slider="$parent.showSearch" class="pull-left col-md-5 sm-search-list" ng-controller="templatesSearchController">
And the templatesSearchController has the following code
app.controller('templatesSearchController',
        ['$scope', '$rootScope', '$timeout', '$state', 'templatesService', 'searchScreenService',
        function ($scope, $rootScope, $timeout, $state, templatesService, searchScreenService) {

            var init = function () {
                doSearch();
            };

            $scope.toggleSearchVisibility = function () {
                $scope.$parent.showSearch = !$scope.$parent.showSearch;
            };

            $scope.table = searchScreenService.getTable('Descrip', [
                { name: 'Descrip' }, { name: 'TmplType' }
            ]);

            var doSearch = function (keepForm) {

                $scope.alertType = '';
                var loadingTimeout = $timeout(function () {
                    $scope.results = null;
                    $scope.isSearchLoading = true;
                }, 250);
                var queryRequest = searchScreenService.getQueryRequest();
                if ($scope.table.isSimpleSearch()) {
                    queryRequest['IsSimpleSearch'] = true;
                    queryRequest['SimpleSearch.SimpleSearchField'] = $scope.simpleSearch;
                } else {
                    queryRequest['IsSimpleSearch'] = false;
                    queryRequest['AdvancedSearch.Descrip'] = $scope.descrip;
                    queryRequest['AdvancedSearch.Hidden'] = $scope.showHidden;
                }
                templatesService.getTemplates(queryRequest).then(function (data) {
                    $scope.results = data.list;
                    if (data.totalCount < 1) {
                        $scope.alertType = 'info';
                        $scope.alertMessage = 'Search returned 0 results.';
                    }
                    if (data.totalCount == 1 && !keepForm) {
                        $scope.loadView($scope.results[0]);
                    }
                    $scope.table.pageCount = data.pageCount;
                    $scope.table.pageSize = data.pageSize;
                    $scope.table.pageNumber = data.pageNumber;
                    $scope.table.totalCount = data.totalCount;
                    $rootScope.$broadcast('sm:resizeContainer');
                    $scope.isSearchLoading = false;
                    $timeout.cancel(loadingTimeout);
                });
            };

            $scope.selectPage = function (page) {
                if ($scope.table.pageNumber != page) {
                    $scope.table.pageNumber = page;
                    doSearch();
                }
            };

            $scope.doSimpleSearch = function () {
                $rootScope.$broadcast('sm:hideForm');
                $scope.table.resetTable();
                doSearch();
            };

            $scope.doAdvancedSearch = function () {
                $rootScope.$broadcast('sm:hideForm');
                $scope.table.resetTable();
                doSearch();
            };

            $scope.toggleDisplayMode = function () {
                $scope.table.toggleDisplayMode();
            };

            $scope.loadView = function (template) {
                $state.go('edit', { id: template.templateID });
                $rootScope.$broadcast('sm:focus');
            };

            $scope.new = function () {
                $state.go('new', {}, { reload: true });
            };

            $scope.$on('templates:doSearch', function (event, keepForm) {
                doSearch(keepForm);
            });

            $scope.search = function () {
                doSearch();
            };

            init();
        }]);
So, this seems to be the line of interest:
 $scope.table = searchScreenService.getTable('Descrip', [
                { name: 'Descrip' }, { name: 'TmplType' }
            ]);
I think I need to first check searchScreenService service code and then it may be clearer if I can just change the names in that code to what I want or not.

Do you think I am on the right track?

Also, all this code is generated automatically by our scaffolding templates. So, if we can figure this out, we may want to adjust the templates.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform