Home

Flexigrid Row Switch

FlexiGrid is a Open Source Tool that can make Tables much easier to deal with

To Initialize save this as a js file called flexi-select.js and

Then to use

changerows(selector_for_dropdown, td_abbr_value);

flexi-select.js
/************************************************************************/
/* Author @ Milo Thompson
/* Date 4-19-2017
/* params(select)
/* JS switch data-attr for location Tables LISTED
/************************************************************************/
function changerows(certain,td_abbr_value){
//GET SELECTED OPTION VALUE
var location_index = $('#'.certain).find(':selected')[0].value;
//STORE LOCATION SWITCH OPERATION For Navigation
//ON EXIT DESTROY THIS LOCALSTORAGE SESSION
localStorage.setItem('siteChanged', 'true');
localStorage.setItem('siteLocation', location_index);
//TABLE NAME ARRAY
var table_names = ['new', 'cancelled', 'completed', 'confirmed', 'paid', 'email-sent'];
table_names.forEach(function(item, index, array) {
$("#"+item+"-flexi tr").each(function () {
$('td', this).each(function () {
check_td_attr($(this),td_abbr_value,location_index,"ALL")
});
});
});
}
/************************************************************************/
/* Author @ Milo Thompson
/* Date 4-19-2017
/* params($(this)//td, abbr_text_value, locationid, special_abbr_value_to_overide)
/* JS switch data-attr for location and force runs on load of each reload
/************************************************************************/
function check_td_attr(item,search,location_index,special){
var value = item.attr('abbr');
if(value == search){
//See if Site Matches Row
if(item.text()== location_index){
item.parent().show();
}else if(location_index == special){
item.parent().show();
}else{
item.parent().hide();
}
}
}

Written by | Milo Thompson

With 5 years of complex coding and implementation experience to go along with Networking Solutions I have Created many Different Software for Many different Platforms. I am the Owner of Jimnio.com, Former Developer for Magnaflow, San Francisco Health Plan, Eburgeon, Software Master, Wendal Wilson Business and Technology Consulting, S&S Tire

Google+ linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll To Top