migration recipe from 1.x to 2.x?

migration recipe from 1.x to 2.x?

loukinglouking Posts: 283Questions: 55Answers: 0

I haven't tried to migrate yet because I have a lot of code and it sounds daunting. I have both datatabases and editor. I see you're working on release 3 now, and I don't want to be further behind...

Is there a recipe somewhere for the migration requirements?

Answers

  • allanallan Posts: 65,719Questions: 1Answers: 10,929 Site admin
    Answer ✓

    Hi,

    Upgrade notes for v1 to v2 are here.

    As long as you weren't using the legacy API (i.e. function names starting with fn) then the upgrade should be fairly painless. The biggest change you are likely to notice is the new layout option which is preferred over dom now. dom will still work, but the styling is focused on layout, so if you use dom, you might need to add a few lines of CSS.

    Allan

  • loukinglouking Posts: 283Questions: 55Answers: 0

    I am finally getting to this. I am trying to use the downloader from https://datatables.net/download/. This used to give the option of getting separate files or a combined file, but I'm only seeing the combined file now. Is it still possible to get the separate files?

  • allanallan Posts: 65,719Questions: 1Answers: 10,929 Site admin
    Answer ✓

    There isn't that option any more I'm afraid. It was always a bit of a bug that - an artifact of how the main file was put together, I just left the individual files on the zip. It caused a number of questions because of the duplication - folks including the main file and the individual files, or not such which to include. So I zapped the individual ones.

    If you want the individual files, choose the CDN option and uncheck the Concatenate option. Then just download the files needed.

    Let me know how you get on with the update.

    Allan

  • loukinglouking Posts: 283Questions: 55Answers: 0
    edited April 22

    I started my upgrade. First thing I notice is when using jquery ui with Editor, the X is missing to close a modal, on investigation, datatables.css refers to an images folder which isn't in the download. I think I might be stuck with jquery ui, unfortunately, as my applications make liberal use of jquery ui widgets.

  • loukinglouking Posts: 283Questions: 55Answers: 0

    I'm also finding other issues -- should I create a new thread for each issue?

  • kthorngrenkthorngren Posts: 22,458Questions: 26Answers: 5,166
    Answer ✓

    My suggestion is to open new threads for each issue. Otherwise a single thread discussing multiple issues can become confusing and one or more issues forgotten about.

    Kevin

  • loukinglouking Posts: 283Questions: 55Answers: 0

    ok -- I'll move the above to a separate thread. Note I don't know how easy it will be for me to make test cases for these.

  • allanallan Posts: 65,719Questions: 1Answers: 10,929 Site admin

    Regarding the images - the download builder doesn't actually include images any more. I thought I'd eliminated them all, but it if one includes jQuery UI's source files in the download builder, apparently not!

    For the moment, select jQuery UI for your styling, but don't include it in the "Libraries" section. Instead, get it from a CDN:

    <link href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/themes/base/jquery-ui.min.css" rel="stylesheet" integrity="sha384-J3tLcWkdGTGEaRTYfKrKVaK5EGVBuxR9rg5ZzQFWRuQD+0hZABemSLVXimw8Nrb9" crossorigin="anonymous">
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js" integrity="sha384-4D3G3GikQs6hLlLZGdz5wLFzuqE9v4yVGAcOH86y23JqBDPzj9viv0EqyfIa6YUL" crossorigin="anonymous"></script>
    

    Or, grab the images directly from your old install and use them. Apologies for that error.

    Regarding other issues - it depends on how complex they are. If it has a complex explanation and test case, then yes, a new thread for each would be best. If trivial, just put them here, numbered so we can identify which one a comment refers to.

    Allan

  • loukinglouking Posts: 283Questions: 55Answers: 0
    edited April 22

    ok, will use the jquery ui library directly. And I'll number the questions here. If you think an issue needs a separate thread, let me know.

    As followup from unnumbered issue 1, I am wondering if the jquery ui library has to be before the combined datatables build, or after if I'm including jquery itself in the combined build?

    Issue 2 (really a question): is there a suggested way to, say, use bootstrap styling with jquery ui widgets? I think I can specify bootstrap in the downloader, then include the jquery ui library (as it looks like I have to include that anyway, but am not sure.

    Issue 3: my fixed columns don't align nicely. I wonder if this is a jquery ui issue as well? This can be easily seen in my development image because I use background color for my page in development, which doesn't seem to color the fixed columns:

    Removed

  • allanallan Posts: 65,719Questions: 1Answers: 10,929 Site admin

    1) I am wondering if the jquery ui library has to be before the combined datatables build, or after if I'm including jquery itself in the combined build?

    Best to include it before.

    Issue 2 (really a question): is there a suggested way to, say, use bootstrap styling with jquery ui widgets?

    Best option is probably to use a Bootstrap theme for jQuery UI. That looks like Bootstrap 3 and it says it is alpha though, so your mileage might vary. There won't be an official way from either of them to do that.

    Issue 3: my fixed columns don't align nicely. I wonder if this is a jquery ui issue as well

    I'll need a link to a page showing the issue please. Does it sort itself out when you click to sort?

    Allan

  • loukinglouking Posts: 283Questions: 55Answers: 0

    regarding issue 1, it seems safest if I include my own jquery and jquery ui before datatables, so that's what I'll do

  • allanallan Posts: 65,719Questions: 1Answers: 10,929 Site admin

    Probably best. It shouldn't matter if jQuery UI is loaded after the DataTables code, but doing it in that order seems sensible :)

  • loukinglouking Posts: 283Questions: 55Answers: 0
    edited April 22

    issue 3: it got worse when I sorted. I'll try to construct a test case, and I guess for this one create a new question

    Removed

  • loukinglouking Posts: 283Questions: 55Answers: 0

    just realized I put personal information for my clients in the images -- is there any way you can delete them or cover up the email addrs / urls?

  • loukinglouking Posts: 283Questions: 55Answers: 0
    edited April 22

    issue 3: I tried but was unable to reproduce the problem in a test case (attempt at https://live.datatables.net/yijazizo/1/edit which includes all the datatables stuff I'm using but the problem wasn't evident).

    I did run the datatables debugger and got debug code ocofac

    Not sure if you have enough information to reproduce this now.

    (also pls see my comment above about emails and URLs inadvertently put into my images)

  • loukinglouking Posts: 283Questions: 55Answers: 0

    Issue 3: By trial and error I found I have an internal css file which is causing my problem. So I'll take that issue from here.

  • allanallan Posts: 65,719Questions: 1Answers: 10,929 Site admin
    Answer ✓

    Images removed.

    Good to hear you found the issue and that it was some external CSS rather than a DataTables error :)

    Allan

  • loukinglouking Posts: 283Questions: 55Answers: 0

    Issue 3: The issue is I have the following css which I use to hide columns in the main table but that I want the editor to see. I guess with datatables 2.x this is interfering with something for the fixed columns:

    See https://live.datatables.net/yijazizo/1/edit

    .dataTable .table_hide
    {
        display: none;
    }
    
  • kthorngrenkthorngren Posts: 22,458Questions: 26Answers: 5,166
    Answer ✓

    Use columns.visible to hide the columns.

    Kevin

  • loukinglouking Posts: 283Questions: 55Answers: 0

    FWIW, these were the only issues seen with the first app converting to datatables 2.x. I did need to use layout rather than dom but that was just a few lines changed in my underlying framework.

    Thanks for the help and for making it so easy.

    If I have other issues as I roll through the other apps, I guess I'll open a separate thread for these as they arise.

  • allanallan Posts: 65,719Questions: 1Answers: 10,929 Site admin
    Answer ✓

    Good stuff - glad to hear it went smoothly.

    DataTables 3 next ;)

    Allan

Sign In or Register to comment.