2016-04-06 17 views
0

Bir web sayfasına komut dosyası enjekte ettim ve liste görünümünden ızgara görünümüne değiştirebileceğim basit bir liste gösteriyor. Bu şuna benzer: Ben butonuna tıklayınEnjekte edilen jquery, açısal kod her zaman çalışmıyor

enter image description here

"NEXT" Ben açısal durumunu ve antoher HTML görünümü değişiklikleri değiştirin. O diğer HTML dosyasında bu liste şablona geri durumunu değiştiren bir düğme "BACK" var, ama geri düğmesine basın sonra ilk şablonuna gidin ve görünümü aşağıdaki gibidir:

enter image description here

Üstelik listeden kılavuza değişen görünüm artık çalışmıyor ...

Bu soruya kodumu yapıştırmam gerekip gerekmediğini bilmiyorum. Ama bu açısal veya belki jüri sorunu mu? Başka fonksiyon gayet güzel çalışıyor "Tüm kontrol" veya "kaydırma"

GÜNCELLEME Google Chrome uzantısını kuruyorum ve liste/tablo görünümleri yapmak için ben MixItUp kütüphanesini

Bu benim Liste denetleyicisi olduğu kullanıyorum hangi resimlerde görünümü kontrol eder:

angular.module('app').controller('ListController', ListController); 

ListController.$inject = ['$scope', '$http', '$location', '$state']; 

function ListController($scope, $http, $location, $state) { 

    var $frame = $('#smart'); 
    var $wrap = $frame.parent(); 
    var layout = 'list', 
     $container = $('#ContainerSelect'), 
     $changeLayouttoList = $('#toLongListSelect'), 
     $changeLayoutToGrid = $('#toGridViewSelect'); 

    // Call Sly on frame 
    $frame.sly({ 
     itemNav: 'basic', 
     smart: 1, 
     mouseDragging: 1, 
     touchDragging: 1, 
     releaseSwing: 1, 
     startAt: 1, 
     scrollBar: $wrap.find('.scrollbar'), 
     scrollBy: 1, 
     speed: 300, 
     elasticBounds: 1, 
     easing: 'easeOutExpo', 
     dragHandle: 1, 
     dynamicHandle: 1, 
     clickBar: 1 
    }); 

    $container.mixItUp({ 
     animation: { 
      animateChangeLayout: true, 
      animateResizeTargets: true, 
      effects: 'fade rotateX(-40deg) translateZ(-100px)' 
     }, 
     layout: { 
      containerClass: 'list' 
     } 
    }); 

    // assign function to onclick property of checkbox 
    document.getElementById('checkbox_field').onclick = function() { 
     // access properties using this keyword 
     if (this.checked) { 
      $(".selectProductCB").prop('checked', $(this).prop("checked")); 
      $(".checkbox_txt").text("Uncheck all"); 
     } else { 
      $(".selectProductCB").prop('checked', $(this).prop("checked")); 
      $(".checkbox_txt").text("Check all"); 
     } 
    }; 

    $scope.next = function() { 
     $state.go("selectNotifier", {}, { location: false }); 
    }; 

    $scope.toLongList = function() { 
     layout = 'list'; 
     $container.mixItUp('changeLayout', { 
      containerClass: layout 
     }); 
    }; 

    $scope.toGridView = function() { 
     layout = 'grid'; 
     $container.mixItUp('changeLayout', { 
      containerClass: layout 
     }); 
    }; 
}; 

Bu düğme geri olan Notifycontroller geçerli:

angular.module('app').controller('NotifyController', NotifyController); 

NotifyController.$inject = ['$scope', '$http', '$location', '$state']; 

function NotifyController($scope, $http, $location, $state) { 
    $scope.back = function() { 
     $state.go("selectList", {}, { location: false }); 
    }; 
    $scope.watchIt = function() { 
     $state.go("target", {}, { location: false }); 
    } 
}; 
Ben devletler aracılığıyla atlama am Bu fonksiyonla

: Açısal sağlar Varsayılan olarak

$scope.close = function() { 
    $state.go("selectList", {}, { location: false }); 
}; 
+0

paylaşım kodu yardımcı olur. Herhangi bir üçüncü taraf kontrolü kullanıyor musunuz? – rupampatel

+0

Ya, en az bir kod yazabilirsiniz. Düzeni değiştirir ve sonraki düğmeler – theblindprophet

+0

için açısal değiştirir JQuery benim sorumu güncellendi - @ rupampatel2006 –

cevap

0

/Eyalet devam etmektedir. Onu kaydetmene gerek yok. Geri Düğmesine tıkladığınızda liste/ızgara görünümü bayrakları/değişkenleri ile ilgili bir sorun olmalıdır.

İlgili konular