Plugin does not display setup!

Plugin does not display setup!

klermannklermann Posts: 277Questions: 67Answers: 1
edited September 2017 in Free community support

Hi, I'm trying out a plugin for the editor, now with just a simple javascript file for a simple field type so when clicking it changes a color as you can see there are no examples that are in this link jscolor.com/examples/, but it seems simple to present it in a field, not editor I can not see it. Where am I going wrong, and what's wrong with my plugin? For both color visualization by javascript and an update coming table, I can not get either!

    ////////// Plugin Color
    (function ($, DataTable) {
        if ( ! DataTable.ext.editorFields ) {
            DataTable.ext.editorFields = {};
        }
        var Editor = DataTable.Editor;
        DataTable.ext.editorFields.color = {
                create: function ( conf ) {
                    var that = this;
                    conf._input = $(
                            '<div class="input-group" id="' + conf.id + '">' +
                            '<input id="receitaCor" class="jscolor form-control" value="#F00" />' +
                        '</div>'
                     );
                    return conf._input;
                },
                get: function ( conf ) {
                    return conf._input.children('input').val();
                },
                set: function ( conf, val ) {
                    console.log(conf._input.val( val ));
                    console.log("val1 ### " + $('input', conf._input).val());
                    var color = $('input', conf._input).val();
                    
                    $('input', conf._input).val(color);
                },
                enable: function ( conf ) {},
                disable: function ( conf ) {}
        };
        })(jQuery, jQuery.fn.dataTable);

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • klermannklermann Posts: 277Questions: 67Answers: 1
    edited September 2017

    on the link is a stripe of the color field for demonstration ec2-54-86-12-163.compute-1.amazonaws.com:8080/financeiro/receitas

    the image shows the color field:

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    You'll need to initialise the colour picker plug-in. Their demos rely upon the input already being in the document when the script is loaded. That isn't the case here since the input is added after the script it loaded.

    I scanned over their site to find some API documentation, but didn't see any. You'll need to ask them how to initialise their plug-in on a dynamically added element.

    Allan

  • klermannklermann Posts: 277Questions: 67Answers: 1

    Hello Allan, I did not quite understand what I meant about dynamically initializing the plugin. I checked the site of this plugin I am using and basically it is just a file (here - localhost:8080/financeiro/global/vendor/ascolor/jscolor.js) that is available for use, and I started it before the body of the page and apparently everything is ok! How should it be done exactly for this feature to work perfectly?

    in the image you can check the operation inside page, noting the loading of the file responsible for the color plugin!

  • klermannklermann Posts: 277Questions: 67Answers: 1
    edited September 2017

    What can I do about it?

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    You would need to ask the author of that plug-in. The question to ask them is: "How do I initialise your software on an input element which has been dynamically added to the page.

    I don't the answer to that since I didn't write that software, nor do I support it under either free support or the paid support.

    Allan

  • klermannklermann Posts: 277Questions: 67Answers: 1

    How Does Paid Support Lenders Work? I do not understand how the credits are spent when they are bought! Are expenses per question? How can each credit be spent?

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited September 2017

    Credits are used at the rate of:

    • 1 credit per minute for non-real time support (e.g. forum / email)
    • 2 credits per minute for real time support (e.g. Skype / screensharing).

    edit To explain further - If it took me 2 minutes to answer a question, only 2 credits would be charged. If a more complex question were asked and it took 30 minutes to answer, 30 would be charged - etc.

    However, as I say, I cannot support third party software.

    Allan

This discussion has been closed.