Changing a field with a corresponding color

0

I'm having a question, not your where to start I have a project that presises a schedule of schedules in which this calendar has a table with several square and presiso change the color of that squares with some colors corresponding to a status and presiso return that status back to the changed bank I thought of doing where the user clicks the square opens a color palette with the color change and each color is related to a status but I do not know how to start

the calendar is the same as the image below  

    
asked by anonymous 01.06.2018 / 18:13

1 answer

0

0 vote against accept $ function () {$ ("td"). dblclick (function () {var conteudoOriginal = $ (this) .text ();

$(this).addClass("celulaEmEdicao");
$(this).html("<input type='text' value='" + conteudoOriginal + "' />");
$(this).children().first().focus();

$(this).children().first().keypress(function (e) {
    if (e.which == 13) {
        var novoConteudo = $(this).val();
        $(this).parent().text(novoConteudo);
        $(this).parent().removeClass("celulaEmEdicao");
    }
});

$ (this) .children (). first (). blur (function () {     $ (this) .parent (). text (contentOriginal);     $ (this) .parent (). removeClass ("cellEmEdit"); }); }); });

$ (function () {var text = $ ("#Editable table td: nth-child (1) td: nth-child (6)"). var result = (text);

if (result == "a") {$ ("# idTd"). css ("background", "# FF0000"); } else if (result == "b") {$ ("# idTd"). css ("background", "# 00FF00"); } else if (result == "c") {$ ("# idTd"). css ("background", "# 0000FF"); } else if (result == "d") {$ ("# idTd"). css ("background", "# 00FFFF"); } else {$ ("# idTd"). css ("background", "# ccc"); } });

    
01.06.2018 / 20:42