JQuery Array remove by value (push, pop, slice 이외의 기능을 쓰고 싶을 때)
·
FrontEnd
//remove function을 만든다. Array.prototype.remove = function(v) { this.splice(this.indexOf(v) == -1 ? this.length : this.indexOf(v), 1); } // ex) var arr = []; // arr.push('a'); // arr.push('b'); // arr.push('c'); arr.remove('b'); console.log(arr); //result ['a','c']
JQuery dataTable 데이터를 가져오는 몇가지 방법
·
FrontEnd
$(document).ready(function() { var table = $('#example').DataTable(); // 1번 $('#example tbody').on('click', 'tr', function () { var data = table.row( this ).data(); alert( 'You clicked on '+data[0]+'\'s row' ); } ); // 2번 $('.dataRow').click(function() { $("#example .selected").find('input[name="inputName"]').val(); }); // 3번 $('.dataRow').click(function() { $(this).val(); //클릭한 해당 값만 ); } );
get previous selectbox value
·
FrontEnd
var previous; $("select").on('focus', function () { previous = this.value; }).change(function() { alert(previous); previous = this.value; });
JQuery ajax for (async : false)
·
FrontEnd
for(let i=0; i
JQuery get/set active tabs
·
FrontEnd
[Simple tabs in bootstrap modal] × 신규/추천 가게 등록 신규 가게 추천 가게 신규/추천 가게 상점명 밴드 점주명 파트너ID 작업내용 지난 내역이 없습니다. ※ 선택한 가게들 중 일반인 가게만 신규/추천 가게로 등록할 수 있습니다. (이미 신규, 추천 혹은 신규/추천으로 등록된 가게는 자동 제외됩니다) 적용하기 닫기 [Jquery 1.12+ ] $(document).ready(function(){ $('#tabs').tabs(); //init tabs important }); //if you don't init tab, you will to occur error like bottom message. //cannot call methods on tabs prior to initi..
JQuery dataTables multi select style AND language config
·
FrontEnd
$(document).ready(function() { $('#example').DataTable( { select: true, language: { select: { rows: { _: "You have selected %d rows", 0: "Click a row to select it", 1: "Only 1 row selected" } } } } ); } ); //...후략 var dTable = $('#dataTable').DataTable({ destroy: true, retrieve: true, stateSave: false, pageLength: 50, bLengthChange: false, autoWidth: false, searching: false, ordering: false, scr..