-1

I have used the jQuery UI Draggable plug-ins to reorder an items in MVC grid. However I'm getting error "jQuery script was attached multiple times and mixed up with DevExpress scripts."

<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

<script>
    var jq112 = jQuery.noConflict(); //
</script>

I have use the above code in the index and web.config settings as below.

<settings rightToLeft="false" embedRequiredClientLibraries="true" doctypeMode="Xhtml" />

enter image description here

Tetsuya Yamamoto
  • 24,297
  • 8
  • 39
  • 61
Shereen
  • 119
  • 1
  • 17
  • Can you provide web.config contents? I'm sure that you're loading jQuery script more than once by using the ` – Tetsuya Yamamoto Dec 04 '18 at 02:35
  • And which DevExpress version you're using? Check if `
    ` used in web.config, then since `embedRequiredClientLibraries="true" ` exists, try setting its value to false and manually register both jQuery and jQuery UI scripts.
    – Tetsuya Yamamoto Dec 04 '18 at 02:43
  • We are using the 18.1.3. I'm reluctant to change the embedRequiredClientLibraries="true" to false as this may affect in other controls. Also there is no
    – Shereen Dec 04 '18 at 02:47

1 Answers1

1

Sounds like the problem occurred because of this CDN script definition, which actually registers separate jQuery copy inside corresponding view page while automatic script registration feature is still enabled and causing resource conflict:

<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

Note that some DevExpress extensions (GridView, PivotGrid, Reports, Charts etc.) require external client-side JS libraries to use their functionality properly, and automatically registered while certain settings enabled inside web.config file (most noticeable is in <resources> section). Here is an explanation why the script registration is enabled, taken from knowledge base:

The client-side resources are automatically added to the Web.config file on adding a DevExpress web control to your application using the DevExpress template gallery. In this case, all necessary client-side libraries are automatically passed to the client.

If you want to register jQuery libraries manually, try remove automatic script registration feature in web.config (see references below for further details).

References:

Script Registration Issues

How to register DevExpress scripts with external client libraries that use jQuery

Embedding Third-Party Libraries

Tetsuya Yamamoto
  • 24,297
  • 8
  • 39
  • 61