Posts

Showing posts from June, 2018

Donate

Bootstrap Table JavaScript Data-Sorter For Currency Column

Image
If your Bootstrap Table by Wenzhixin has a string currency column with a dollar sign and you want to sort the amount which disregards the currency symbol, a solution would be to remove the currency symbol and comma using Regex in JavaScript. function AmountSorter(a, b) { var billA = Number (a.replace( /(^\$|,)/g , '' )); var billB = Number (b.replace( /(^\$|,)/g , '' )); if (billA < billB) return - 1 ; if (billA > billB) return 1 ; return - 0 ; } And in your Bootstrap Table column, set the data-sorter property with the name of your currency sorter function. <th data-field= "RegistrationFee" data-sortable= "true" data-sorter= "AmountSorter" > Registration Fee </th> Output Sample Fiddle: Bootstrap Table JavaScript Data-Sorter For Currency Column

WPF Busy Overlay Or Busy Indicator Example In C#

Image
Greetings all! I've been doing some research on how to add an overlay feature similar to an Ajax busy modal to one of my WPF projects. A simple approach led me to this topic WPF: Simple "Busy" Overlay . Since I'm using the traditional MVVM and not Simon Cropp’s Notify Property Weaver, I made this work by creating a WPF project using Visual Studio 2017 (installed in my workstation) and then copied the codes specifically BoolToVisibilityConverter.cs , BusyViewModel.cs , DelegateCommand.cs and MainWindow.xaml from his example at BitBucket . I also changed the IsBusy property to implement the OnPropertyChanged event private bool _IsBusy; public bool IsBusy { get { return _IsBusy; } set { _IsBusy = value ; OnPropertyChanged( "IsBusy" ); } } and added the implementation of that event. protected void OnPropertyChanged ( string propertyName) { if (PropertyChanged != null ) PropertyChanged( this , new PropertyChangedEventArgs(propertyName)

Donate