Telerik Forums
Kendo UI for jQuery Forum
4 answers
339 views

Hi,

 

I am using the latest Kendo UI version (2016.2.714) and found a bug in the colorpicker.

The buttons (Apply and Cancel) are rendered as

<button class="k-button k-primary apply">Apply</button>
<button class="k-button cancel">Cancel</button>

(see kendo.colorpicker.js line 504 for details or check  the source on github)

When included in a form both of the buttons always cause the form to get submitted when they get clicked as this is the common behavior of a button tag. Both of them should have the type attribute set to "button" to prevent the form from getting submitted. The rendered buttons should look like this:

 

<button type="button" class="k-button k-primary apply">Apply</button>
<button  type="button" class="k-button cancel">Cancel</button>

 

Best regards

 

Thomas

Thomas
Top achievements
Rank 1
 answered on 29 Aug 2016
1 answer
57 views

I tried putting color picker inside the window but the picker is behaving strangely and is hidden. Do we have a clean css to fix this problem?

 

Ivan Zhekov
Telerik team
 answered on 13 Nov 2015
1 answer
468 views
Hi kendo Team:
Is there any way to tell kendo color picker that the color I want to select is transparent color? I've tried to set 'transparent' or clear the input box, but it doesn't work.

Kind regards,
Oscar.
Alex Gyoshev
Telerik team
 answered on 24 Dec 2014
0 answers
125 views
Hi there,


Just thought I would like to share my color picker for the editor, similar to the one in Microsoft Word:

@(Html.Kendo().Editor()
.Name("Editor")
.Tools(tools => tools
    .Clear()
    .Bold().Italic().Underline().Strikethrough()
    .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
    .InsertUnorderedList().InsertOrderedList()
    .Outdent().Indent()
    .CreateLink().Unlink()
    .InsertImage()
    .InsertFile()
    .SubScript()
    .SuperScript()
    .TableEditing()
    .ViewHtml()
    .CleanFormatting()
    .Formatting()
    .FontName()
    .FontSize()
    .FontColor(color => color.Palette(new string[] {
        "#ffffff", "#000000", "#e7e6e6", "#44546a", "#5b9bd5", "#ed7d31", "#a5a5a5", "#ffc000", "#4472c4", "#70ad47",
        "#f2f2f2", "#7f7f7f", "#d0cece", "#d6dce4", "#deebf6", "#fbe5d5", "#ededed", "#fff2cc", "#d9e2f3", "#e2efd9",
        "#d8d8d8", "#595959", "#aeabab", "#adb9ca", "#bdd7ee", "#f7cbac", "#dbdbdb", "#fee599", "#b4c6e7", "#c5e0b3",
        "#bfbfbf", "#3f3f3f", "#757070", "#8496b0", "#9cc3e5", "#f4b183", "#c9c9c9", "#ffd965", "#8eaadb", "#a8d08d",
        "#a5a5a5", "#262626", "#3a3838", "#323f4f", "#2e75b5", "#c55a11", "#7b7b7b", "#bf9000", "#2f5496", "#538135",
        "#7f7f7f", "#0c0c0c", "#171616", "#222a35", "#1e4e79", "#833c0b", "#525252", "#7f6000", "#1f3864", "#375623",
        "#c00000", "#ff0000", "#ffc000", "#ffff00", "#92d050", "#00b050", "#00b0f0", "#0070c0", "#002060", "#375623",
  }))
    .BackColor(color => color.Palette(new string[] {
        "#ffffff", "#000000", "#e7e6e6", "#44546a", "#5b9bd5", "#ed7d31", "#a5a5a5", "#ffc000", "#4472c4", "#70ad47",
        "#f2f2f2", "#7f7f7f", "#d0cece", "#d6dce4", "#deebf6", "#fbe5d5", "#ededed", "#fff2cc", "#d9e2f3", "#e2efd9",
        "#d8d8d8", "#595959", "#aeabab", "#adb9ca", "#bdd7ee", "#f7cbac", "#dbdbdb", "#fee599", "#b4c6e7", "#c5e0b3",
        "#bfbfbf", "#3f3f3f", "#757070", "#8496b0", "#9cc3e5", "#f4b183", "#c9c9c9", "#ffd965", "#8eaadb", "#a8d08d",
        "#a5a5a5", "#262626", "#3a3838", "#323f4f", "#2e75b5", "#c55a11", "#7b7b7b", "#bf9000", "#2f5496", "#538135",
        "#7f7f7f", "#0c0c0c", "#171616", "#222a35", "#1e4e79", "#833c0b", "#525252", "#7f6000", "#1f3864", "#375623",
        "#c00000", "#ff0000", "#ffc000", "#ffff00", "#92d050", "#00b050", "#00b0f0", "#0070c0", "#002060", "#375623",
  }))
).Encode(false)
.Value(@<text>
  <p>
      Kendo UI Editor allows your users to edit HTML in a familiar, user-friendly way.<br />
      In this version, the Editor provides the core HTML editing engine, which includes basic text formatting, hyperlinks, lists,
      and image handling. The widget <strong>outputs identical HTML</strong> across all major browsers, follows
      accessibility standards and provides API for content manipulation.
  </p>
  <p>Features include:</p>
  <ul>
      <li>Text formatting & alignment</li>
      <li>Bulleted and numbered lists</li>
      <li>Hyperlink and image dialogs</li>
      <li>Cross-browser support</li>
      <li>Identical HTML output across browsers</li>
      <li>Gracefully degrades to a <code>textarea</code> when JavaScript is turned off</li>
  </ul>
  <p>
      Read <a href="http://docs.telerik.com/kendo-ui">more details</a> or send us your
      <a href="http://www.telerik.com/forums">feedback</a>!
  </p>
</text>)
.ImageBrowser(imageBrowser => imageBrowser
    .Image("~/Content/UserFiles/Images/{0}")
    .Read("Read", "ImageBrowser")
    .Create("Create", "ImageBrowser")
    .Destroy("Destroy", "ImageBrowser")
    .Upload("Upload", "ImageBrowser")
    .Thumbnail("Thumbnail", "ImageBrowser"))
.FileBrowser(fileBrowser => fileBrowser
    .File("~/Content/UserFiles/Images/{0}")
    .Read("Read", "FileBrowser")
    .Create("Create", "FileBrowser")
    .Destroy("Destroy", "FileBrowser")
    .Upload("Upload", "FileBrowser"))
)

And the css styles to go along with that:

.k-colorpalette
{
    border: 1px solid gray;
    padding-right: 3px;
}
 
.k-palette .k-item
{
    border-style: solid;
    border-color: White;
    border-width: 0px 3px 0px 3px;
}
 
.k-palette tr:first-child
{
    border-top: 3px solid white;
    border-bottom: 5px solid white;
}
 
.k-palette tr:last-child
{
    border-top: 5px solid white;
    border-bottom: 3px solid white;
}
Lasse
Top achievements
Rank 1
 asked on 15 Oct 2014
8 answers
1.4K+ views
I had been getting random errors when navigating through my app. After digging down into the issue if found the cause.

When elements are removed from the down the scope must be destroyed. Angular Kendo listens to the $destroy event and responds by  removing any remaining event handlers as to minimize memory leaks.

Starting at this this method:
```
// Cleanup after ourselves
scope.$on( '$destroy', 
   widget.destroy();
});
```

I only have the minified version of kendo.all.js, but the destroy method goes a little like

```
destroy: function() {
this.wrapper.off(y).find("*").off(y);
this._popup && (this._selector.destroy(), this._popup.destroy());
this._selector = this._popup = this.wrapper = null;
h.fn.destroy.call(this)
}
```


The issue for me is the wrapper property is null by the time destroy is invoked. My guess is Angular and  JQuery removes this element before kendo has the chance to do so.





Alex Gyoshev
Telerik team
 answered on 07 Oct 2014
1 answer
113 views
I'm trying to fire an event without change happening and I'm having some trouble figuring it out.

I have the Kendo UI widget on my webpage and the default value is #000000 when the color picker loads. If I click the Apply button in the color picker the 'change' event doesn't fire because I didn't change anything. If I change the slider and click 'Apply' then the value changes and is also put into the 'input text' field.
How do I get it so the value #000000 is set when I click Apply without changing anything?

Code snippet:
<input type="text" class="text colorPicker" size="25" maxlength="100" title="${geo:loc attribute=&quot;title&quot; phrase=&quot;Please enter the hexadecimal value for the font color.&quot; /}" name="${geo:object name='CntwChooseColorScheme.PRIMHEAD_FONTCOLOR' attribute='name'/}" id="${geo:object name='CntwChooseColorScheme.PRIMHEAD_FONTCOLOR' attribute='id'/}" value="${geo:object name='DERIVED_COMPONENT.Wizard.GetValue(CntwChooseColorScheme.PRIMHEAD_FONTCOLOR)' attribute='value'/}" /> <input id="primaryheaderfontcolor" type="color" value="${geo:object name='DERIVED_COMPONENT.Wizard.GetValue(CntwChooseColorScheme.PRIMHEAD_FONTCOLOR)' attribute='value'/}" /> <script> $("#primaryheaderfontcolor").kendoColorPicker({ value: "#000000", buttons: true, change: function(e) { $('#prim_head_font_color').val(e.value); console.log("The picked color is ", e.value); console.log(e); } }); </script>
Kiril Nikolov
Telerik team
 answered on 11 Jul 2014
5 answers
284 views
Hello,

I have recently implemented the Color Picker in my site and I'm having issues in IE 11.  The color picker opens, however, the color picker slider circle that allows me to click on any shade of color doesn't work and always stays in the upper right corner. It will not move.

I'm also not able to enter in a value and apply it, however the default value can be applied by just clicking the Apply button.

Here's a snippet of code implementing the Color Picker

<input id="primaryheadercolor" type="color" value="${geo:object name='DERIVED_COMPONENT.Wizard.GetValue(CntwChooseColorScheme.PRIMARY_HEADERCOLOR)' attribute='value'/}" />
<script>
$("#primaryheadercolor").kendoColorPicker({
buttons: true,
change: function(e) {
$('#primary_header_color').val(e.value);
console.log("The picked color is ", e.value);
console.log(e);
}
});
</script>

The following three files are included.
<link href="/geonext/js/Frameworks/KendoUI/styles/kendo.common.min.css" rel="stylesheet" type="text/css" />
<script src="/geonext/js/Frameworks/KendoUI/js/jquery.min.js" type="text/javascript"></script>
<script src="/geonext/js/Frameworks/KendoUI/js/kendo.web.min.js" type="text/javascript"></script>

Screenshot is attached of what I see in IE11.
Ethan
Top achievements
Rank 1
 answered on 24 Jun 2014
1 answer
316 views
I use the Kendo UI Web v2014.1.318.
I try with Firefox and Google Chrome.

I cannot select a manual color through the input.

When I open the color picker, the focus is done to an input before the color picker.
When I click in the color input, I cannot get the focus to enter the color.

01.<div class="silx-setting-settings-dialog ui-dialog-content ui-widget-content" id="ui-id-5" style="width: auto; min-height: 50px; max-height: none; height: auto;">
02.    <div class="silx-row">
03.      <label>!! Action label:</label>
04.      <input type="text" class="silx-setting input settingLabel" value="Systematic Rejection">
05.    </div>
06.   
07.    <script type="text/javascript">
08.       
09.        var as_Color = "#cccccc";
10.       
11.   
12.      $(".settingBackgroundColor").kendoColorPicker({
13.        value: as_Color,
14.        buttons: false,
15.        change: function(e) {
16.           $(".previewSettingImage").css("backgroundColor", e.value);
17.        },
18.        select: function(e) {
19.           $(".previewSettingImage").css("backgroundColor", e.value);
20.        }
21.      });
22.    </script>
23.    <div class="silx-row">
24.      <label>!! Background color:</label>
25.      <span role="textbox" aria-haspopup="true" class="k-widget k-colorpicker k-header" aria-disabled="false" tabindex="0" aria-label="Current selected color is #cccccc" aria-owns="6fb0d2e4-e256-4d54-9bb3-853eb40cdec6"><span class="k-picker-wrap k-state-default"><span class="k-selected-color" style="background-color: rgb(204, 204, 204);"></span><span class="k-select" unselectable="on"><span class="k-icon k-i-arrow-s" unselectable="on"></span></span></span><input class="silx-setting input settingBackgroundColor" data-role="colorpicker" style="display: none;"></span>
26.    </div>
27.   
28.    <script type="text/javascript">
29.      $(".settingImage").kendoComboBox({
30.        dataTextField: "text",
31.        dataValueField: "value",
32.  template: '<span class="k-state-default"><img width="26" height="26" src="/Root/Global/plugins/silx-extendable-dashboard/img/silcActions/#:data.text#" alt="#:data.text#" /></span>',
33.        dataSource:
34.        [
35.          { text: "Systematic Rejection.png", value: "Systematic Rejection.png" },
36.          { text: "dashboard-exit.png", value: "dashboard-exit.png" },
37.          { text: "logo-vertech.png", value: "logo-vertech.png" }
38.        ],
39.        change: function(e) {
40.          $(".previewSettingImage").css("background-image", "url(/Root/Global/plugins/silx-extendable-dashboard/img/silcActions/" + e.sender.input.val() + ")");
41.        }
42.      });
43.   
44.      var ao_KendoCombo = $("input.silx-setting.settingImage:hidden").data("kendoComboBox");
45.      ao_KendoCombo.value("Systematic Rejection.png");
46. 
47.      $(".addImageFile").kendoButton(
48.        {
49.          click: function(e) {
50.            UploadImageFile(e);
51.          }
52.        }
53.      );
54.    </script>
55.    <div class="silx-row">
56.      <label>!! Image:</label>
57.      <span class="k-widget k-combobox k-header silx-setting input settingImage" style=""><span tabindex="-1" unselectable="on" class="k-dropdown-wrap k-state-default"><input class="k-input silx-setting input settingImage" type="text" autocomplete="off" maxlength="524288" role="combobox" aria-expanded="false" tabindex="0" aria-disabled="false" aria-readonly="false" aria-autocomplete="list" aria-owns="" aria-busy="false" style="width: 100%;"><span tabindex="-1" unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s" role="button" tabindex="-1">select</span></span></span><input class="silx-setting input settingImage" data-role="combobox" aria-disabled="false" aria-readonly="false" style="display: none;"></span>
58.      <button type="button" class="addImageFile k-button" style="font-size:20px;line-height:20px;" data-role="button" role="button" aria-disabled="false" tabindex="0">...</button>
59.      <div class="previewSettingImage silc-action-button" style="background-color: rgb(204, 204, 204); float: right; margin-right: 175px; margin-top: 0px; background-image: url(http://192.168.1.185:8080/Root/Global/plugins/silx-extendable-dashboard/img/silcActions/dashboard-exit.png);"></div>
60.    </div>
61.   
62.    <div class="silx-row">
63.      <label>!! Order:</label>
64.      <input type="text" class="silx-setting input settingOrder" value="1">
65.    </div>
66.     
67.    <div class="silx-settings">
68.      <button class="silx-settings-cancel">Annuler</button>
69.      <button class="silx-settings-ok">Ok</button>
70.    </div></div>


Regards,
Michaël Gauthier
Kiril Nikolov
Telerik team
 answered on 18 Apr 2014
1 answer
55 views
There aren't a lot of graphical examples of the k-* properties for styling and there's no documentation (that I can find) for control specific styling.
Thanks.

Jeff
Kiril Nikolov
Telerik team
 answered on 20 Jan 2014
4 answers
194 views
I'm not sure if this post would be better suited in the Grid forum or the Color Picker forum, so I apologize if I chose the wrong location.

Kendo UI Version: 2013.3.1119
I am using the ASP.NET MVC markup for the grid

I have a grid that is using batch editing which has a cell that has an editor template that is an HSV Color Picker.
When I select the cell for editing, the widget is fine in all browsers except IE 11.

In IE 11, the widget loads correctly and also opens correctly, but the issue comes when I attempt to change the color by clicking on the drag handler to move it around the canvas on the screen.  I've included images of the before and after, but basically, the drag handler loads in the correct location, but when it is clicked, it immediately 'jumps' to the far left side of the page and refuses to drag to the right unless I take the cursor way to the right of the widget.

Here is my grid code and my detail template information.  Please let me know if you need any more information.
<script type="text/javascript">
    function RefCarrierRank_ErrorHandler(e) {
    }
 
    function RefCarrierRankEdit(e) {
        if (e.container[0].cellIndex == 2) {
            $(".k-selected-color").css("width", "100%");
            $("#RankColor").data("kendoColorPicker").open();
        }
    }
</script>
 
<div id="RefCarrierRankContainer">
    <h3 style="margin:1px;">Rank Dictionary</h3>
 
    @(Html.Kendo().Grid(Model.AdminModel.GlobalDictionary.RefCarrierRankModels)
        .Name("RefCarrierRank")
        .Columns(columns =>
        {
            columns.Bound(item => item.Name);
            columns.Bound(item => item.Rank)
                .EditorTemplateName("RefCarrierRank/Rank");
            columns.Bound(item => item.RankColor)
                .ClientTemplate("<div class='k-textbox' style='background-color:#=RankColor#; width:80px; height:20px;'></div>")
                .EditorTemplateName("RefCarrierRank/RankColor").Width(100);
            columns.Command(command =>
            {
                command.Destroy();
            }).Width(100);
        })
        .ToolBar(toolbar =>
        {
            toolbar.Create();
            toolbar.Save();
        })
        .Events(events =>
        {
            events.Edit("RefCarrierRankEdit");
        })
        .Editable(editable => editable.Mode(GridEditMode.InCell).CreateAt(GridInsertRowPosition.Top))
        .Navigatable(navigatable => navigatable.Enabled(true))
        .Pageable(pageAction =>
        {
            pageAction.PageSizes(new int[] { 5, Model.AdminModel.GlobalDictionary.RefCarrierRankModels.Count });
        })
        .Sortable()
        .Scrollable()
        .Filterable()
        .Resizable(resize => resize.Columns(true))
        .DataSource(dataSource => dataSource
            .Ajax()
            .Batch(true)
            .ServerOperation(false)
            .Events(events =>
            {
                events.Error("RefCarrierRank_ErrorHandler");
            })
            .Sort(sort =>
            {
                sort.Add("Rank").Ascending();
            })
            .Model(model =>
            {
                model.Id(i => i.RefCarrierRankID);
                model.Field(i => i.Rank).DefaultValue(Model.AdminModel.GlobalDictionary.RefCarrierRankModels.Max(i => i.Rank) + 1);
                model.Field(i => i.RankColor).DefaultValue("#a8a8a8");
            })
            .Read(read => read.Action("GetRefCarrierRanks", "Dictionary"))
            .Create(create => create.Action("CreateRefCarrierRanks", "Dictionary"))
            .Update(update => update.Action("UpdateRefCarrierRanks", "Dictionary"))
            .Destroy(delete => delete.Action("DeleteRefCarrierRanks", "Dictionary"))
        )
    )
</div>
@(Html.Kendo().ColorPicker()
    .Name("RankColor")
    .Value("#=RankColor#")
    .Opacity(true)
)
Jark Monster
Top achievements
Rank 1
 answered on 03 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?