angularjs - Generated ng-table sort is not working -


मैं इस तरह से कुछ प्रदर्शित करना चाहूंगा:

और एक कॉलम हेडर (वें) पर क्लिक करके, मेरी मेज सॉर्ट करें लेकिन, मैं अपने डेटा संरचना के साथ एनजी-टेबल घटक का उपयोग करने के लिए प्रबंधन नहीं करता। तालिका सही ढंग से प्रदर्शित करती है लेकिन सॉर्ट काम नहीं कर रहा है।

HTML

  & lt; तालिका ng-table = "tableParams" class = "table" & gt; & Lt; tr class = "keyword-info" & gt; & LT; वें & gt; & lt; / वें & gt; & Lt; th ng- दोहराने = "AppKeywords में कीवर्ड [0] .keywordDensity" & gt; {{keyword.keyword}} & lt; / th & gt; & Lt; / टीआर & gt; & Lt; tr class = "keyword-info" एनजी-दोहराने = "AppKeywords में ऐप" & gt; & Lt; td & gt; & lt; span class = "bold" & gt; {{app.name}} & lt; / span & gt; & lt; br & gt; {{app.totalKeywordDensity}}% ({{app.totalKeywordCount}}) & lt; / टीडी & gt; & Lt; td sortable = "'stats.density'" एनजी-दोहराने = "app.keywordDensity में आँकड़े" & gt; {{stats.density}}% ({{stats.number}}) & lt; / td & gt; & Lt; / टीआर & gt; & Lt; / तालिका & gt;  

नियंत्रक

  $ scope.tableParams = नया ngTableParams ({पेज: 1, // शो पहले पेज की गिनती: 10 // प्रति पृष्ठ गिनती}, {कुल: $ scope.AppKeywords.length, // डेटा की लंबाई प्राप्त करेंडेटा: फ़ंक्शन ($ defer, params) {var का आदेश दिया डेटा = पैराम्स। सपोर्टिंग ($) $ फिल्टर ('orderby') ($ scope.AppKeywords, params.orderBy ()): $ Scope.AppKeywords; $ scope.AppKeywords = $ filter ('orderby') ($ scope.AppKeywords, params.orderBy ()); $ defer.resolve ($ scope.AppKeywords);}});  

ऐपकीवर्ड:

Console.log ($ दायरा एपीपीकीवर्ड)

मुझे यकीन नहीं है कि आपकी तालिका संरचित है लेकिन आमतौर पर एनजी-तालिका क्रमबद्ध होने की आवश्यकता है

  & lt; td sortable = "'stats.density'" एनजी-दोहराने = "app.keywordDensity में आँकड़े" & gt; {{ Stats.density}}% ({{stats.number}}) & lt; / td & gt;  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -