Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do you remove/reset javascript date sliders that were created programmatically?
    primarykey
    data
    text
    <p>Good day! Hoping someone can help me out with the issue I'm seeing.</p> <p>I'm creating a bunch of javascript date sliders like this:</p> <pre><code>// Create the slider for this product. $("#Product" + index).dateRangeSlider({ bounds: { min: new Date(2010, 10, 1), max: new Date(2018, 10, 1, 23, 59, 59) }, // yyyy-m-d HH:MM:SS defaultValues: { min: new Date(StartDate[0], StartDate[1] - 1, StartDate[2]), max: new Date(EndDate[0], EndDate[1] - 1, EndDate[2]) }, // yyyy-mm-dd, slider starts month from 0, hence the "-1". allowResize: false }).bind("valuesChanged", myEventHandler); </code></pre> <p>They are "attached" to<code>&lt;div /&gt;</code> elements that looks like this:</p> <pre><code>&lt;div style="top: 6em; position: absolute; margin-left: 175px"&gt; &lt;div id="Product1" style="width: 950px; margin-left: 60px"&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I have a bunch of these <code>&lt;div /&gt;</code> elements and the javascript loops through them all and creates a slider for each one.</p> <p>Here' the problem: When I call it the first time, it works great. If I call the javascript routine again (after updating the number of things I want to display - either add/remove) things look really messed up. The formatting is way off: The sliders are pushed way out of the <code>&lt;div /&gt;</code> elements, the boxes with the dates that are attached to the sliders aren't in the correct location, etc.</p> <p>It's like I need to remove all the sliders and then re-add them - a sort of "reset" for everything created by the first call that generated the sliders. I haven't the slightest idea how to do this, or if this is even the fix for the problem.</p> <p>Any ideas?</p> <p>Help! :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload