update portion of Kendo code without updating everything - kendo-ui

We're in a situation where we can't upgrade Kendo due to the fact that a number of changes were made to the CSS files and we don't have the time right now for additional QA (However we are planning to go the proper upgrade route in the next version of our product).
in versions prior to 2013 Q3 SP1 the kendo.toString function didn't format very small decimal numbers correctly, which we know has been fixed since then:
http://www.telerik.com/support/whats-new/kendo-ui-web/release-history/q3-2013-sp1-web
Is it possible to somehow grab the .toString function from the latest version and plug it into the old 2013 version? And how? I've scanned through the Kendo min file, but it looks dangerous. I was actually hoping there was a way to patch it by adding an additional file that would override the function, but it doesn't look as if Kendo works that way.

That part of Kendo is open source, so you can get the new implementation from here:
https://github.com/telerik/kendo-ui-core/blob/master/src/kendo.core.js#L1048-L1058
Then you can just replace kendo.toString with your own implementation, something like:
var fixedToString = function () { ...};
kendo.toString = fixedToString;
However internally some parts of Kendo might hold the old implementation in a closure, so it might not work everywhere. It's worth a try though...

Related

Slickgrid sorting a hierarchy

I have created a slickgrid hierarchy that has only 2 levels. The implementation of the hierarchy follow example 5 (https://6pac.github.io/SlickGrid/examples/example5-collapsing.html). I am using the following fork - http://6pac.github.io/SlickGrid. I want to sort only by the first level and have the children be in the same order. I tried adding the sortable property to the column, but that did not do anything. Any pointers on how to do this, I have no idea where to begin. As always many thanks in advance.
There's couple thing to note about that example you are referencing.
You're on your own in regards to sorting the data in that Example, in short it means you'll have to add your own sorting functions and you'll end up with have to create a lot recursive functions (because hierarchical data is only sortable through recursion)
It would be better to have pre-built to do that kind of work and since I needed that as well, I started a feature change that will eventually be merged into the 6pac/SlickGrid fork, I briefly talk about it in this issue post where you can see an animated gif. But never got time to finish it and I'm also waiting for someone's help to finish it. Unless we merge it has is
The feature I started is this Example from my fork which will eventually be merged. You could use that code and it should work, but you would also require a new SlickGrid Plugin that we created plugins/slick.treeData.js with some helpers for the recursion stuff (remember that sorting tree data with hierarchy requires you to use recursion, fun time that is... if you like pulling your hair)
Or the final option would be to use my other lib Slickgrid-Universal which is a wrapper on top of SlickGrid (so it uses the 6pac/SlickGrid fork and is a dependency). This new lib that I created is framework agnostic (it could be used in any framework) and the sample is written in plain TypeScript (or JavaScript is you wish), there's 2 sample for hierarchical dataset Tree Data with parentId references and Tree Data with hierarchical dataset
what I wanted to add eventually in my lib is to support the SlickGrid built-in Aggregators but never got time to finish it (that is actually the same thing blocking option 2 that I wrote on top).
If you're using other frameworks, I also created 2 other libs Angular-Slickgrid and Aurelia-Slickgrid which have the same feature set as option 3.
So pick your choice from the list, it's not an easy one to work with but these are the current options, obviously the option 1 is the hardest since option 2-3 basically means that I did the work of option 1 already.
The option 2 can be seen in this animated gif

Multiple formatter functions in Bokeh datatable

Is it possible to do multiple format types within one "formatter"? For example:
TableColumn(field="y", title="y",formatter=HTMLTemplateFormatter(), NumberFormatter(),DateFormatter())
etc
No it's not possible. Bokeh currently only accepts a single CellFormatter per TableColumn. You could try opening an issue on Bokeh's Github to allow thge formatter argument to accept a list of CellFormatters. Or, you may look into hooking up either a JS or python callback to the TableColumn to do some more sophisticated formatting.
Two and a half years later, but...... This is currently being developed now. Keep an eye on the Bokeh repo for addition of this function, hopefully in the near future.

How best to suppress javascript:S3827 when my code uses Microsoft Asp.Net Ajax code?

Problem: we are wanting to use SonarJS but much of our old Javascript code uses functions from the Microsoft ASP.Net framework (and the MS AjaxToolkit). As such we have a couple of hundred occurrences of the error "XXX" does not exist. Change its name or declare it so that its usage doesn't result in a "ReferenceError". (where XXX is Sys, Type, $get etc.).
I appreciate that I could suppress these by specifying them all in the sonar.javascript.globals property (as per the Elena Vilchik's answer to this question ) but it feels like what I really want to do is to add my own bespoke entries in sonar.javascript.environments (called msajax and msajaxtoolkit say). Then I could be more precise about when to include / exclude these globals.
So I guess I would like to know whether defining my own environment is supported or if there is a more elegant solutions overall.
Thanks in advance.
You are more than welcome to open pull request for https://github.com/SonarSource/sonar-javascript. Edit "javascript-frontend/src/main/resources/org/sonar/javascript/tree/symbols/globals.json" by adding new group/groups of names.

Poedit: Avoid Reordering of translations in .po file

I use Poedit in a project for localization. Whenever I change an entry with poedit, it reorders all elements. I think it reorders the elements according to their line number and file but since I´m working with many coders on this project, poedit must not reorder all elements to avoid unneccessary line changes in the repository. Does anyone know how to achieve that?
Poedit never, under any circumstances, reorders content of the file when you “change an entry”. Files are always saved in the order they had when loaded, and it’s been like this since the very first version.
I have two explanations:
Either you’re confusing content of the file with the view presented in Poedit (where you can select your preferred display order in the View menu), in which case just change the display to whatever you like. But this seems unlikely.
Or you’re talking about not “changing an entry” in the file, but updating the PO file from source code. If that’s the case, it’s possible that you or some of your coworkers are using some very old version of Poedit. The fix would be to update to the current version, because the scan order was fixed to be stable across platforms in v1.6.5 1.3 years ago.
If it’s neither, you need to describe the issue reproducibly.

How do I set up label/value when using JuiceUI's AutoComplete control from codebehind?

The JuiceUI AutoComplete control accepts a string[] for the Source property, yet in documentation it says you can use label/value pairs. I'm not very familiar with the jQuery autocomplete stuff to begin with, and after searching for a while I can't seem to find the correct syntax to make this work. Can anyone help me out? I'm looking for something like this:
UserAutoComplete.Source = users.Select(u => new { label = u.Id, value = u.Name});
Nice catch. Please file this as an issue here: https://github.com/appendto/juiceui/issues and we'll get a fix in there for the next release.
In the mean time, I'd use a separate map to map labels to actual values. It's a bit hackey, but it'll get you by until we update, and it'll be an easy transition with the updated code.

Resources