简体   繁体   中英

How do I install SlickGrid (or any jQuery plugin) on my site?

I have all jQuery files in the js folder. I noticed that the SlickGrid download contains its own copy of jQuery. I'd prefer to have a single copy of jQuery for my own code as well as SlickGrid. Presently the folder hierarchy looks like this:

mysite/
  js/
    SlickGrid/
      build/
      css/
      examples/
      images/
      lib/
        jquery-1.4.3.min.js
        jquery-1.8.5.custom.min.js
        ...
      MIT-LICENSE.txt
      slick.columnpicker.css
      ...
    jquery-1.5.1.min.js
    jquery-ui-1.8.13.custom.min.js

Is there a way to rearrange the folder hierarchy so that only a single copy of jQuery is used? Is it advisable?

in my humble opinion , it depends how demand you are. If you want to keep the folder structure then you should test if the plugin does also work with the newer versions of jquery and jquery-ui. If so, then you have to change all script includes to new .js files. You can use an extra program to do the changes automatically, like Search & Replace . After that move the newer ones to the 'lib' folder and delete the other files.

from my experience, when using jquery plugins we can copy the relevant plugin script, the css and images to what ever folder we need. when referring the plugin, we refer from that folder. in this case u can remove the jquery scripts provided with Slick grid and refer the one you already use.

PLS NOTE : when moving css files, the images referred in css also should be moved to specific folders accordingly.

Since there's so much in the SlickGrid git repo that I don't want to have in my own source tree I've been pulling it into directory outside my project's tree and copying the files I need into the appropriate places in my source.

This is kind of a crappy solution since it takes a while to update. So what I've been thinking of doing is making the copies of the SlickGrid files in my source tree into links to the outside repo. So when I pull a new version of SlickGrid the copies in my tree would update automatically.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM