Base solution for your next web application
Open Closed

RangeSlider from Metronic theme #1500


User avatar
0
vitaly created

Hello,

I have problem with integrating ion.RangeSlider plugin in my SPA:

  1. Added to ScriptPaths.cs public const string Ion_RangeSlider = "~/libs/ion-rangeslider/js/ion.rangeSlider.js";

  2. Added to StylePaths.cs public const string Ion_RangeSlider = "~/libs/ion-rangeslider/css/ion.rangeSlider.Metronic.css"; public const string Ion_RangeSlider_Nice = "~/libs/ion-rangeslider/css/ion.rangeSlider.skinNice. public const string Ion_RangeSlider_Norm = "~/libs/ion-rangeslider/css/normalize.css";

  3. Added to AppBundleConfig.cs ScriptPaths.Ion_RangeSlider -> ScriptBundle .Include(StylePaths.Ion_RangeSlider_Norm)->StyleBundle .Include(StylePaths.Ion_RangeSlider)->StyleBundle .Include(StylePaths.Ion_RangeSlider_Nice)->StyleBundle

  4. Added in createOrEditModl.js function ($scope, $uibModalInstance, storeService, storeGroupService, storeId) { var vm = this; var range = $("#range_id"); ... function init() { vm.getStoreForEdit(); vm.getStoreGroups();

             range.ionRangeSlider({});
    
  5. Added in createOrEditModal.cshtml <input type="text" id="range_id" value="" name="range" />

As a result - it doesn't work. On the form I have standard imput field. Please help me)


3 Answer(s)
  • User Avatar
    0
    vitaly created

    Could you help me?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I didn't use this plugin before but as I checked from metronic sample page, you should use these css files.

    public const string Ion_RangeSlider = "~/libs/ion-rangeslider/css/ion.rangeSlider.css"; public const string Ion_RangeSlider_Nice = "~/libs/ion-rangeslider/css/ion.rangeSlider.skinNice.css";

    You can change "ion.rangeSlider.skinNice.css" to any other css file like skinFlat or skinModern but ion.rangeSlider.css must be used.

    Then, in the modal dialog you just need to inject $timeout

    '$scope', '$uibModalInstance', '$timeout', .....,
            function ($scope, $uibModalInstance, $timeout, ...) {
    

    Then, in the init function, run your ion slider code like this,

    $timeout(function () {
        $("#range_id").ionRangeSlider();
    }, 0);
    

    Since you are running jquery code in angular, you just need to wait a little to catch the dom object.

    I hope this helps,

  • User Avatar
    0
    vitaly created

    Thank you! It helped.