Giter VIP home page Giter VIP logo

bootstrap-table-multiple-sort's Introduction

Table Multiple Sort

Use Plugin: bootstrap-table-multiple-sort

Usage

<script src="extensions/multiple-sort/bootstrap-table-multiple-sort.js"></script>

Options

showMultiSort

  • type: Boolean
  • description: Set true to allow the multiple sort.
  • default: false

sortPriority

  • type: Object
  • description: Set one or multiple sort priority. Example: '[{"sortName": "forks_count","sortOrder":"desc"},{"sortName":"stargazers_count","sortOrder":"desc"}]'
  • default: null

Icons

  • sort: glyphicon-sort
  • plus: glyphicon-plus
  • minus: glyphicon-minus

Locales

formatMultipleSort

  • description: Title of the advanced search modal
  • default: Multiple Sort

formatAddLevel

  • description: Text of the add level button
  • default: Add Level

formatDeleteLevel

  • description: Text of the delete level button
  • default: Delete Level

formatColumn

  • description: Text of Column header
  • default: Column

formatOrder

  • description: Text of the delete level button
  • default: Order

formatSortBy

  • description: Text of the delete level button
  • default: Sort by

formatThenBy

  • description: Text of the delete level button
  • default: Then by

formatSort

  • description: Text of the delete level button
  • default: Sort

formatCancel

  • description: Text of the delete level button
  • default: Cancel

formatDuplicateAlertTitle

  • description: Title of the duplicate alert
  • default: Duplicate(s) detected!

formatDuplicateAlertDescription

  • description: Text of the duplicate alert
  • default: Please remove or change any duplicate column.

formatSortOrders

  • description: Text of the sort orders
  • default: asc : Ascending and desc : Descending

Events

onMultipleSort(multiple-sort.bs.table)

  • Fires when sorting with one or multiple Sort Priority.

bootstrap-table-multiple-sort's People

Watchers

 avatar

Forkers

cteipen

bootstrap-table-multiple-sort's Issues

Button Class Problem

Plugin ignores <table data-buttons-class="primary"> setting. It always uses btn-default class for modal open button.

Request: Make sortPriority independent of showMultiSort

Forgive this if I'm missing something important, but I believe it would be better if showMultiSort was independent of sortPriority. As of now, if I use sortPriority and give it an order, showMultiSort appears to need to be true for the priority to work. If I say false or don't define showMultiSort in the table, the sortPriority has no effect.

Therefore, for my table, I'm having to override the multisort icon visibility in the Sass/CSS.

The multiple-sort plugin doesn't take into consideration if column has a "sorter" property defined (which defines the function for sorting).

var sortOrder = [{"sortName": "day_of_week","sortOrder":"asc"},{"sortName":"start_time","sortOrder":"asc"}];

$el.bootstrapTable({
columns: columns
,data: data
, sortPriority:sortOrder
, showMultiSort:true
});

where

columns.push({
field: 'day_of_week',
title: tableColumnsLabels["day_of_week"],
sortable: true,
sorter:"sortDays",
editable: false,
align: 'center',
width:'80'
});
columns.push({
field: 'start_time',
title: tableColumnsLabels["start_time"],
sortable: true,
sorter:"sortTime",
align: 'center'
});

function sortDays(a,b){
....
}

function sortTime(a,b){
....
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.