jquery

How to pass extra parameters for in row edit/save action in free-jqgrid?

泄露秘密 提交于 2021-01-28 11:20:58
问题 I have a jgrid and the code is below. I wish to send some extra parameters to the server when the save icon in each row is clicked. How to do this? let colNames = ['Designation', 'No. of Resource(s) Required', 'Competence for Job', 'Skill of Resource', 'Time Required(in %)', 'From', 'To', 'Reason For Request', 'Assigned Person(s)', 'Current Role in Project', 'resource_type', 'Billing']; let colModel = [ {name:'resource_designation', index:'resource_designation', resizeable:true, editable:

How to use one ajax datasource with multiple JQuery Datatables

旧巷老猫 提交于 2021-01-28 11:12:14
问题 There are two datatables on the same page and both have different columns. Is there a way to use the same ajax datasource to draw multiple tables? I am trying avoid multiple calls to database. $('#gvData').DataTable({ "processing": true, //"serverSide": true, "bPaginate": false, "bFilter": false, "bInfo": false, "scrollY": "300px", "scrollCollapse": true, "bDestroy": true, "ajax": { "dataType": 'json', "contentType": "application/json", "type": "POST", "url": "myform.aspx/GetData", "data":

How to move a div away from mouse

北城余情 提交于 2021-01-28 11:11:02
问题 I'm making a landing page, in which I want my logo to move when followed by a mouse cursor which means I want to move it away from the direction of mouse, but it is just moving randomly and not in a precise way. It's just a html page and I can use any open source, preferred javascript. <!DOCTYPE html> <html lang="en"> <head> <style>.container { margin: 0 auto; width: 300px; height: 300px; border: 1px #000 solid; position: relative; } .box { width: 50px; height: 50px; border: 1px #000 solid;

Highcharts - Combine & superimpose columns

落爺英雄遲暮 提交于 2021-01-28 11:06:44
问题 I found tutorials and answers about how to combine charts, superimpose them, but none about both at the same time. Here is a picture of what I mean: I tried some stuff, here is what I have done so far : http://jsfiddle.net/8vCEs/37/ var chart; $(document).ready(function () { chart = new Highcharts.Chart({ chart: { renderTo: 'container', type: 'column' }, tooltip: { shared: false }, plotOptions: { column: { stacking: 'normal' } }, series: [{ name: '1', data: [100], grouping: false, }, { name:

how to add CSS to -webkit-slider-runnable-track using Javascript

本小妞迷上赌 提交于 2021-01-28 10:54:24
问题 I am trying to change the range slider lower color depends upon the slide. Using below code. <head> </head> <input type="range" min="1" max="100" step="1" value="15"id="myrange" class="myrange"> CSS: input[type="range"] { width: 100%; height: 28px; -webkit-appearance: none; outline: none; border: 0; /*for firefox on android*/ padding: 0 8px; /*for IE*/ margin: 8px 0; } /*chrome and opera*/ input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; transition: 0.3s;

Jquery validate - show messages with Toastr

淺唱寂寞╮ 提交于 2021-01-28 10:51:46
问题 I'm using jquery validate.js for validating a form. I want to show the validation messages as Toastr popups, I've tried to add the Toastr function like this : .... messages: { "email": { required: function() { toastr.warning("Warning") }, email: "Email is invalid" } }, .... but it's keeps duplicate the popup for some reason - and instead of one popup - it creates 3.... I want to prevent messages duplication also - so if there is an error message than only one will displayed - no matter how

Filter table with on data attribute with jQuery

醉酒当歌 提交于 2021-01-28 10:48:51
问题 I am trying to filter a table based on data attribute, instead on value inside the td tag. The problem is, that I can't get it to work, because I always get this error: Uncaught TypeError: Cannot call method 'match' of undefined $(document).ready(function(){ var elemens = $("td") searchInput = $("#search") searchInput.on('keyup',function(){ elemens.each(function(){ var re = new RegExp(searchInput.val(), 'gi'); if( $(this).data('gui').match(re) === null ) { $(this).parent('tr').hide(); }else{

Bootstrap Popover Doesn't Close on Clicking Outside

安稳与你 提交于 2021-01-28 10:48:01
问题 I followed this solution on how to close a Bootstrap Popover when clicking anywhere outside, https://stackoverflow.com/a/14857326/1005607 $('body').on('click', function (e) { //only buttons if ($(e.target).data('toggle') !== 'popover' && $(e.target).parents('.popover.in').length === 0) { $('[data-toggle="popover"]').popover('hide'); } }); But something still doesn't work, my JSFiddle: https://jsfiddle.net/m2k0wgys/3/ In this JSFiddle, clicking outside doesn't close the Popover. My Popovers

jQuery AutoComplete displaying behind elements after first use

十年热恋 提交于 2021-01-28 10:47:51
问题 SOLVED: Ended up being that the Z-index of the task editor div was being set higher than the autocomplete when the div was appended to the body. Now I just feel silly spending two hours with this. I am currently modifying a jQuery Gantt Chart plugin (here is a link to the original plugin demo http://gantt.twproject.com/distrib/gantt.html). And I am trying to change the task editing by adding an auto-complete to the resource rows so that it is easy to grab an employee from my company. The

assigning ID's to body tag using jquery

荒凉一梦 提交于 2021-01-28 10:46:02
问题 Help on this guys, I have here a script that adds an ID on body tag this is the result I see <body id="xxx-cat"> with the script I'm using below <script> $(document).ready(function(){ // Edit xxx-cat to match desired category link id: $('body').attr("id","xxx-cat"); if ($('body[id]')) { var bid = $("body").attr("id"); // Keep the next command on one line $('div.droplinebar li a[class='+bid+']').addClass('current'); } }) </script> How can I make the ID's (1,2,3,4), because I have 4 pages and