Editor field types on github.

Editor field types on github.

yajrayajra Posts: 13Questions: 1Answers: 1

Hi Allan,

Is it ok if I publish the custom editor fields scripts on github so that I can reuse it on my projects? And of course, I will not publish the editor full files, just the plugins like editor.select2.js etc.

Here are the assets link on github: https://github.com/yajra/laravel-datatables-assets

Thanks,

Arjay

Replies

  • mguinnessmguinness Posts: 49Questions: 9Answers: 0
    edited September 2019

    I doubt that would be acceptable. Read LICENSEE'S UNDERTAKINGS section in Editor commercial license which presumably includes plugins. If the repos are private and under the licensee's control this is not an issue. A simple rule of thumb is that if code is not available in DataTables repo then you cannot share with others (even in minified form).

  • allanallan Posts: 52,624Questions: 1Answers: 8,049 Site admin

    HI Arjay,

    I'd rather you didn't if that's okay please. Obviously you can host them somewhere since you need to use them, but my feeling is that if they are in github then other developers might mistakenly assume they are also open source. Do you have a server you can put them up on and just use them for there?

    Thanks,
    Allan

  • yajrayajra Posts: 13Questions: 1Answers: 1

    Hi Allan

    Thanks for the feedbacks. I have a gitlab account that I uses for private repositories. I will just put it there I guess to avoid open source confusions.

    BTW, I think the plugins posted on site is not updated and is not working when using npm. That is what prompts me to this question because I made some minor adjustments for it to work. I just added the .net part.

    define(['jquery', 'datatables.net', 'datatables.net-editor'], factory);
    

    Regards,

    Arjay

  • yajrayajra Posts: 13Questions: 1Answers: 1

    @mguinness thanks for the feedback too and the link to license part.

  • allanallan Posts: 52,624Questions: 1Answers: 8,049 Site admin

    Which npm instructions were you looking at? The docs here I think are correct.

    Thanks,
    Allan

  • yajrayajra Posts: 13Questions: 1Answers: 1

    The script provided in select2 plugin: https://editor.datatables.net/plug-ins/field-type/editor.select2. When I try to compile it on npm, it fails.

    Thanks,

    Arjay

  • allanallan Posts: 52,624Questions: 1Answers: 8,049 Site admin

    In what way does it fail? We don't provide that script on npm, so I'm not quite sure what you mean.

    Allan

  • yajrayajra Posts: 13Questions: 1Answers: 1

    This is the error when I remove .net when compiling editor.select2.js script.

    define(['jquery', 'datatables', 'datatables-editor'], factory);
    
    ERROR in ./resources/js/fields/editor.select2.js
    Module not found: Error: Can't resolve 'datatables' in '/www/tenant/resources/js/fields'
     @ ./resources/js/fields/editor.select2.js 95:4-66
     @ ./resources/js/app.js
    

    Another error which is not part of the post but with select2 is a missing canReturnSubmit method. Fixed by adding the code below.

            canReturnSubmit: function() {
                return false;
            }
    

    Arjay

  • allanallan Posts: 52,624Questions: 1Answers: 8,049 Site admin

    Hi Arjay,

    I see what you mean about the define line. That's wrong now - it should be:

    define( ['jquery', 'datatables.net', 'datatables.net-editor'], factory );
    

    Thanks for letting me know about that.

    canReturnSubmit isn't a required method, but yes, it should be there in this case. It will be alongside the 1.9.1 release.

    Allan

Sign In or Register to comment.