End-to-end software consulting services for web, mobile, and cloud-based solutions
Architect and optimize cloud-native solutions that enhance agility, resilience, and cost efficiency.
Modernize legacy systems into secure, scalable, and future-ready digital platforms.
Strengthen your technology landscape by embedding security and compliance into every layer.
Unlock business value by defining and implementing a clear, results-driven AI roadmap.
Design intuitive, user-centric interfaces that elevate engagement and drive measurable outcomes.
Validate product ideas and define a focused MVP roadmap that accelerates time to market.
Craft seamless end-to-end product experiences that align user needs with business goals.
Build scalable, high-performance web applications tailored to your unique business workflows.
Develop intuitive, feature-rich mobile apps that deliver seamless experiences across devices.
Engineer robust, extensible platforms that support growth, integrations, and evolving business needs.
Connect systems and streamline operations by designing secure, reliable APIs and integrations.
Enable agility and resilience by migrating, managing, and optimizing your cloud infrastructure.
Create resilient, scalable cloud-native applications built for performance and rapid innovation.
Accelerate releases and improve reliability by implementing automated, scalable DevOps practices.
Transform ideas into scalable, intelligent AI solutions.
Develop generative AI and LLM-powered applications that automate workflows and enhance human productivity.
Create intelligent conversational systems that deliver natural, context-aware customer interactions.
Deploy autonomous AI agents that reason, plan, and execute complex tasks across systems.
Implement computer vision systems that extract real-time insights from images and video streams.
Design and operationalize scalable data pipelines and ML systems that power intelligent decision-making.
Execute comprehensive manual and automated testing to accelerate releases without compromising reliability.
Optimize system performance by identifying bottlenecks and validating stability under peak loads.
Identify vulnerabilities and strengthen defenses through rigorous security testing and risk assessment.
Validate APIs for reliability, performance, and security to ensure seamless communication between systems and applications.
Ensure stability and continuous improvement through proactive monitoring, maintenance, and ongoing application support.
Transform legacy applications into scalable, cloud-ready systems built for performance and agility.
Migrate applications and infrastructure to the cloud with minimal disruption and optimized performance.
Drive measurable growth by running data-driven campaigns optimized for conversions, CAC, and ROI.
Improve organic visibility and rankings by optimizing your content, technical SEO, and search authority.
Improve app visibility and downloads by optimizing listings, keywords, and conversion elements across app stores.
Enhance your datasets with accurate, actionable insights that improve targeting, personalization, and decision-making.
Extend your team with skilled dedicated developers who align with your goals, workflows, and delivery timelines.
Set up a scalable offshore development center to accelerate product delivery while optimizing costs and operational efficiency.
Build secure, compliant healthcare solutions that improve patient outcomes and streamline operations.
Tailored healthcare apps built around your workflows, patients, and care delivery goals.
Secure virtual care platforms that connect patients and providers anytime, anywhere.
Intelligent EMR/EHR systems that streamline clinical workflows and improve care coordination.
Digital experiences that keep patients informed, connected, and actively engaged in their care journey.
Remote patient monitoring solutions that enable proactive care beyond hospital walls.
Smart home healthcare platforms that simplify caregiving, scheduling, and patient management.
AI-powered healthcare solutions that automate operations, enhance diagnostics, and improve patient outcomes.
Scalable SaaS products engineered for rapid growth, seamless user experiences, and recurring revenue.
Modernize legacy systems with cloud-native architectures, better performance, and future-ready technology.
Build a high-performing offshore development team that works as a seamless extension of your business.
Access skilled developers on demand to accelerate product delivery and scale engineering capacity.
Get strategic technology leadership and product direction without the cost of a full-time CTO.
Intelligent POS solutions that streamline billing, inventory, and customer experiences across retail operations.
Tailor-made accounting software designed to simplify financial operations and improve business visibility.
High-performance trading platforms built for secure, real-time, and seamless stock market transactions.
Robust digital platforms for secure gold trading, portfolio management, and real-time market insights.
Innovative insurance technology solutions that automate processes and enhance customer experiences.
Feature-rich eCommerce apps designed to deliver seamless shopping experiences across devices.
Direct-to-consumer commerce platforms that help brands drive engagement, loyalty, and sales growth.
Scalable multi-vendor marketplace platforms built for smooth transactions and business expansion.
End-to-end retail software solutions that optimize operations, inventory, and customer experiences.
Custom travel applications that simplify bookings, itineraries, and customer experiences.
Smart fleet and asset management systems that improve tracking, utilization, and operational efficiency
Digital ticketing and fare management solutions built for seamless payments and transit operations.
Build feature-rich OTT platforms that deliver seamless video streaming experiences across web, mobile, and smart devices.
Develop scalable live streaming applications with real-time broadcasting, low latency, and interactive user experiences.
Create flexible, user-friendly CMS solutions that simplify content management and support seamless digital experiences.
Develop secure, scalable core banking software that streamlines financial operations and enhances customer experiences.
Build cloud-based banking solutions that improve agility, scalability, and operational efficiency for modern financial institutions.
Create intelligent loan management software to automate lending workflows, improve compliance, and accelerate loan processing.
Build intelligent inventory management systems that optimize stock control, streamline operations, and reduce inefficiencies.
Develop reliable POS systems that simplify transactions, improve customer experiences, and support business growth.
Create comprehensive restaurant management software to streamline orders, inventory, billing, and daily operations.
Design custom CRM software tailored to your workflows to improve customer engagement, sales tracking, and business efficiency.
Discover who we are, what we build, and the values that drive our innovation journey.
Collaborate with us to create scalable technology solutions and shared business success.
Build your future with a team passionate about technology, innovation, and growth.
Meet the leaders shaping our vision, culture, and technology-driven growth
Explore conversations on technology, innovation, business trends, and digital transformation.
Insights, trends, and expert perspectives from the world of technology and software engineering.
Driving meaningful social impact through responsible initiatives and community-focused programs.
You: Multi-column sort, why do we even want it? We have simple sortingMe: Because it will give you simple sorting along with some extra feature You: Which extra features?Me: Read below 🙂
What is a Multi-Column Sort?
Multi-column sort lets you sort columns one after another in such a way that the previous sort order does not get damaged by the next sort order.
Let’s understand it, with an example.
Let say you have this table:
Let’s say, you want a table with countries name in ascending order and with corresponding state rank in ascending order as well.
Therefore, in this operation:
The results after applying the above operation would be.
Hence, in sorting, we only consider one column value at a time but in multi-column sort, we can consider multiple column values at a time.
Note: In multi-column sort, a sort of order made previously must not get damaged by the next sort orders.
Where to use Multi-column sort?
Multi-column Sort changes are visible when we have several duplicate values in the table. If we have unique values then we may not observe these changes.
I know it might seem little confusing, however, remember “In multi-column sort, a sort of order made previously must not get damaged by the next sort orders.” Try to observe this in the table.
How to achieve multi-column sort in AngularJS?
In AngularJS we have a filter “orderBy” and by using that we can implement multi-column sort easily.
For example:
In the table above, on “Table A” we can perform (Sort by: Name, order: Ascending) and we can achieve the following:
Then we get “Table B” as a result.
In “Table A” we can perform (Sort by: Name, order: Ascending and Then by: Age, order: Ascending), by this we obtain:
Hence, we get “Table C” as a result.
In the above cases, we have used the “+” sign for ascending order and “-” sign for descending order.
So, for implementing multi-column sort we simply have to push the column name into an array along with prefix, “+” and “-” as per the selected order, after which we assign that array value to “orderBy” filter.
Implementation of the multi-column sort in AngularJS
View: Sample of how Multi-sort works
In the above sample,
You get to see a table and a button with name “multi-column sort”
When you click on button then modal (Dialogue box) opens
You can add or delete a row by clicking on “Add” and “Delete” button
On modal, you have to select the column name from the dropdown and corresponding order (we have implemented dropdown value in such way that the column you selected above will never appear in below dropdown)
Then click on Sort
Try to observe how values are changing.
For code visit my GitHub
To know how it is implemented, follow below steps. Every next step changes are highlighted.
Steps:
The basic setup of the angular environment.
Create a table and pass values
Create a modal for column and order selection
Manage the dropdown values
Sort
Step 1: Create a html file (index.html) and JS file (script.js) as per AngularJS format.
index.html:
</body></html>
script.js
Step 2: Create a table and pass column name values in array and Table values in object type.
Script.js
app.controller(“myController”, ($scope) => {$scope.employees=employees; $scope.multiplesort=columnValue;
});
Step 3: create a multicolumn sort button to open the modal and create the modal
modal.html
<div class=”modal-body”><div class=”feature-button”><buttonid=”add”type=”button”ng-disabled=”add_sort_button”ng-click=”addRow()”><i class=”fa fa-plus”></i> Add Sort</button> <buttonid=”delete”type=”button”ng-disabled=”delete_sort_button”ng-click=”deleteRow()”><i class=”fa fa-minus”></i>Delete Sort</button></div><div class=”modal-table”><table class=”module-row” class=”table”><thead><tr><th></th><th><div class=”th-inner”>Column</div></th><th><div class=”th-inner”>Order</div></th></tr></thead><tbody><tr ><td>SortBy</td><td><selectng-init=”elements[-1].col = data[0]”class=”dropdown”ng-model=”elements[-1].col”ng-change=”onsortBychange(elements[-1].col,-1)”ng-options=”option for option in data”></select>
</td><td><select class=”dropdown” ng-model=”elements[-1].order” ><option value=”asc”>Ascending</option><option value=”desc”>Descending</option></select></td></tr><tr ng-repeat=”element in elements”><td>ThenBy</td><td><selectng-init=”element.col = element.values[0]”class=”dropdown”ng-change=”onsortBychange(element.col,$index)”ng-model=”element.col”ng-options=”option for option in element.values”></select></td><td><select class=”dropdown” ng-model=”element.order”><option value=”asc”>Ascending</option><option value=”desc”>Descending</option></select></td><td><i class=”fa fa-trash” ng-click=”delete_particularcol(element.col,$index)”></i></td></tr></tbody></table></div></div><br /><div class=”modal-footer”><buttonclass=”gs-minus-header ng-scope”type=”button”class=”btn btn-secondary”ng-click=”modalclose()”data-dismiss=”modal”>Cancel</button> <buttonclass=”gs-minus-header”type=”button”class=”btn btn-primary”ng-click=”onclickSort()”aria-disabled=”false”style=”background-color: lightskyblue;”>Sort</button></div></div></div>
Step 4: Inside the controller, we wright all function logic
For opening and closing the modal
For adding and deleting a row
For managing the dropdown
$scope.receivedData=$scope.multiplesort;$scope.sortColumn=[]$scope.receivedData.forEach((item, i)=>{$scope.sortColumn[i]={ col: “”, order: “asc”, values: [] };});// ——————————-
$scope.data=$scope.receivedData$scope.index = 0;$scope.elements = [];$scope.dataselected = [];$scope.result = [] = [{ col: “”, order: “asc” }];$scope.elements[-1] = $scope.sortColumn[-1]= {col: “”,order: “asc”,values: $scope.data,};$scope.add_sort_button = false;$scope.delete_sort_button = true;// ————————————
$scope.addRow = function () {$scope.delete_sort_button = false;if ($scope.elements.length <= 0)$scope.dataselected.push($scope.elements[-1].col);else$scope.dataselected.push($scope.elements[$scope.elements.length – 1].col);if ($scope.elements.length < $scope.data.length – 1) {$scope.sortColumn[$scope.index].values = $scope.data.filter((item) => !$scope.dataselected.some((other) => item == other));$scope.sortColumn[$scope.index].col =$scope.sortColumn[$scope.index].values[0];$scope.elements.push($scope.sortColumn[$scope.index]);}if ($scope.elements.length == $scope.data.length – 1)$scope.add_sort_button = true;$scope.index++;};// ——————————–$scope.deleteRow = function () {$scope.add_sort_button = false;$scope.elements.pop();$scope.sortColumn[$scope.elements.length] = {col: “”,order: “asc”,values: [],};$scope.index–;$scope.dataselected.pop();if ($scope.elements.length <= 0) $scope.delete_sort_button = true;};// —————————————————$scope.onsortBychange = function (changeval, changedindex) {if (changedindex == $scope.elements.length – 1) return;let prevval = $scope.dataselected[changedindex + 1];for (let i = changedindex + 1; i < $scope.elements.length; i++) {var position = $scope.elements[i].values.indexOf(changeval);$scope.elements[i].values[position] = prevval;if ($scope.elements[i].col == changeval) {$scope.elements[i].col = prevval;}}let changeval_dataselected = $scope.dataselected.indexOf(changeval);if (changeval_dataselected > -1)$scope.dataselected[changeval_dataselected] = prevval;$scope.dataselected[changedindex + 1] = changeval;return;};// ——————————-$scope.delete_particularcol = function (delval, delindex) {$scope.add_sort_button = false;if (delindex == $scope.elements.length – 1) {$scope.elements.pop();$scope.sortColumn[$scope.elements.length] = {col: “”,order: “asc”,values: [],};$scope.index–;} else {for (let i = delindex + 1; i < $scope.elements.length; i++) {$scope.elements[i].values.push(delval);}$scope.elements.splice(delindex, 1);let position = $scope.dataselected.indexOf(delval);$scope.dataselected.splice(position, 1);$scope.sortColumn[$scope.elements.length] = {col: “”,order: “asc”,values: [],};$scope.index–;}};// ————————-$scope.onclickSort = function () {$scope.result[0] = {col: $scope.elements[-1].col,order: $scope.elements[-1].order,};for (let i = 1; i <= $scope.elements.length; i++) {$scope.result[i] = {col: $scope.elements[i – 1].col,order: $scope.elements[i – 1].order,};}$scope.modalOpen=false;console.log(JSON.stringify($scope.result));$scope.chosen_multisort=[];for(let i=0;i<$scope.result.length;i++){if($scope.result[i].order===”asc”)$scope.chosen_multisort.push(‘+’+$scope.result[i].col);else if(d3ata[i].order===”desc”)$scope.chosen_multisort.push(‘-‘+$scope.result[i].col);}console.log(JSON.stringify($scope.chosen_multisort));};// ————————$scope.modalclose = function () {$scope.modalOpen=false; };
Step 5: Finally add the sorted column array with sign-in “orderBy” filter
References: Modal look
AngularJS has now been around for quite some time and has gained notable acclaim in the web development domain. AngularJS is apt for web enterprise development. This front end framework’s focus mainly lies on code quality and testability, making it great for developers. Want to hire Angular Developers? Do visit us today.
Want to work abroad? Check out jobs in the USA here.
Topics: Software Development
Shivani Yadav is a software developer at Daffodil Software. She likes to share and enhance her knowledge by writing articles, making cool videos, and creating awesome memes.
Previous Post
6 Technologies and Trends that will rule 2021
Next Post
Daffodil Software gets listed in the Zinnov Zones ER&D 2020 Ratings