Telerik Forums
Kendo UI for jQuery Forum
1 answer
707 views

Hello,

we are drawing a kind of graph on top of the map. We are currently trying to draw some text as well and we have gotten it to work kind of.
At the end I am going to include a small script to show how we are doing it right now and also show what the problem is.
We not only need to draw these things but they need to be clickable too. currently we use geojson with an id that allows us to reference the data behind a geojson point.

with the text we are cheating a bit because we interscept and prevent the default shape from being created and append it's dataItem to our new shape which makes it clickable. the problem is it isnt cleaned up well and it will be drawn over if the data changes. in the worst case if the location changes the new shape will be drawn in the new location but the previously drawn ones in the old location are not cleaned up.

Would be lovely if anyone has a tip on how to do in a nice way.

if you execute the fillowing code you will see the text is drawn on top of the previous text while you cannot see the same effect with the native Geojson Lines


function Guid() {
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
        var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
        return v.toString(16);
    });
} 
function rand() {
    return Math.random()*360 - 180;
}
function onMarkerClick(e) {
    console.log(e);
}
function createMap() {
    var datasrc = new kendo.data.DataSource({
        type: "geojson",
        data: []
    });
    var datasrc1 = new kendo.data.DataSource({
        type: "geojson",
        data: []
    });
    var map = $("#map").kendoMap({
        center: [0, 0],
        zoom: 12,
        layers: [{
            type: "tile",
            urlTemplate: "https://#= subdomain #.tile.openstreetmap.org/#= zoom #/#= x #/#= y #.png",
            subdomains: ["a", "b", "c"],
            attribution: "© <a href='http://osm.org/copyright'>OpenStreetMap contributors</a>"
        },
        {
            type: "shape",
            dataSource: datasrc,
        },{
            type: "shape",
            dataSource: datasrc1,
        }],
        markerClick: onMarkerClick,
        markerCreated: onMarkerCreated,
        shapeCreated: onShapeCreated,
    }).data("kendoMap");

    let arr = [];
    let arr1 = [];
    
    for (var i = 0; i < 20; i++) {
        arr.push({type: "Feature", id: Guid(), geometry: {type: "Point", coordinates: [0,0-i*0.005]}})
        datasrc.data(arr)
    }


    for (var i = 0; i < 30; i++) {
        arr1.push({type: "Feature", id: Guid(), geometry: {type: "LineString", coordinates: [[-5,0.08 - i * 0.002], [5,0.08- i * 0.002]]}})
        datasrc1.data(arr1)
    }
}

$(document).ready(createMap);

function onMarkerCreated(e) {
e.preventDefault()
}
function onShapeCreated(e) {
if (e.shape.dataItem.geometry.type == "Point") {
    console.log("creating shape")
    var bbox = e.shape.bbox();
    var center = bbox.center()
    var label = new kendo.drawing.Text("Lorem Ipsum");
    var labelCenter = label.bbox().center()
    label.position([
        center.x - labelCenter.x,
        center.y - labelCenter.y
    ])
    label.dataItem = e.shape.dataItem;
    e.layer.surface.draw(label);
    e.preventDefault();
} else {
    console.log("creating line")
}
}

Georgi Denchev
Telerik team
 answered on 15 Dec 2021
2 answers
738 views

Hello,

I'm new here and I'm trying to figure out how can I drag and drop from a Grid to a TreeView

I found this example http://dojo.telerik.com/eWIgu/2

It's something like this what I want to do, but in the example I can't put an element in a certain node of the TreeView, I just add elements to the data source. So how can I do that? I need your help

 

PS. I also want to do this with a listbox instead of a grid. That's possible?

  
Neli
Telerik team
 answered on 15 Dec 2021
1 answer
2.1K+ views
Hello,

I have a scenario when I want to disable special weekdays from  Datepicker so the user can't choose those days.
Currently, the app is using react so is there a way to disable dates for kendo UI Datepicker

Patrick | Technical Support Engineer, Senior
Telerik team
 answered on 14 Dec 2021
2 answers
133 views
I searched about this a lot and I'm confused.
I'm a beginner web developer and I'm about to finish Javascript's basics, I will go to libraries and stuff like that
So I want your answer, do I need to learn Jquery or just use Javascript DOM?
I heard that Jquery is outdated and is getting ditched in favor of React so I'm confused right now.
Lopez
Top achievements
Rank 1
Iron
 updated answer on 14 Dec 2021
1 answer
133 views

Dear team,

we are using kendo grid, with  server pagination.In one of our senario we need to move last page in programatically,for this we are using dataSource.page(pagenumber) in databound function it is moving fine also,but it is calling sever actions infinitly,Please suggest the way to resolve the issue

Martin
Telerik team
 answered on 14 Dec 2021
1 answer
385 views

How do I change the TEXT color of the kendo grid edit button for Inline editing?

 

Thanks

Justin

Martin
Telerik team
 answered on 14 Dec 2021
1 answer
136 views

Hi,

Can i bind a flat data table to a PivotGridV2?

 

Thanks

Giulio

Georgi Denchev
Telerik team
 answered on 14 Dec 2021
17 answers
4.3K+ views
Hi Guys

Is it possible to turn off the column menu on certain columns ?

I have tried setting the grid options as follows :

    columnMenu: { columns: false },
    columns: [{
         field: "MAJ_RE_BASE",
         title: "Base",
         filterable: false,
         sortable: false,
         menu: false,
 
but this still shows the column menu icon.

Which leads onto another slight problem that if you now click on the icon a small blank menu is drawn with no content (see ColumnMenu.png)

I have trawled through the docs & forums for guidance but have so far drawn a blank.

Therefore any help would be much appreciated.

Thanks
Alan

Frederic
Top achievements
Rank 1
Veteran
Iron
 answered on 10 Dec 2021
0 answers
150 views

Hey guys,

currently I have an use-case where I could need a radio group with some standard text options but one radio with a dropdownlist.
With googling I could find only one question similar to this with a solution in kendoReact.

Is there a best practice solution to realize this in .NET Core?

https://www.telerik.com/forums/dropdownlist-with-radio-button-not-working
And a working example here: https://stackblitz.com/edit/react-1gnbzt?file=app/main.jsx

Does it make sense to combine radio buttons for common options with a drop  down menu for less common options? - User Experience Stack Exchange

Cheers!

 

EDIT:

Sure, like always. After asking the question, I could solve it by myself. Thanks anyways! 

@(Html.Kendo().RadioGroup()
                    .Name("xxx")
                    .Items(i =>
                    {
                        i.Add().Label("United States").Value("1");
                        i.Add().Label("Canade").Value("2");
                        i.Add().Label("Mexiko").Value("3");
                        i.Add().Value("4").Encoded(false).Label("Other: " + Html.Kendo().DropDownListFor(x => x.ProviderId)
                                    .DataSource(source => source
                                        .Custom()
                                        .Sort(x => x.Add(Html.NameFor(y => new Provider().Name)))
                                        .Transport(x => x
                                            .Read(read =>
                                            {
                                                read.Url($"https://{webApiHost}/fruehehilfen/api/Provider").Headers(new { authorization = user.TokenString });
                                            })))
                                    .DataTextField(Html.NameFor(x => new Provider().Name))
                                    .DataValueField(Html.NameFor(x => new Provider().ID))
                                    .HtmlAttributes(new { style = "width: 100%" })
                                    .OptionLabel("Bitte auswählen").ToHtmlString());
                    })
                )
Daniel
Top achievements
Rank 3
Iron
Iron
Iron
 updated question on 10 Dec 2021
0 answers
172 views

Hi, I have a problem like this the image,

how can I fix this labels overlap issue,'m using kendo jquery ui

Thanks...

Chiran
Top achievements
Rank 1
Iron
Iron
 asked on 10 Dec 2021
Narrow your results
Selected tags
Tags
Grid
General Discussions
Charts
Data Source
Scheduler
DropDownList
TreeView
MVVM
Editor
Window
DatePicker
Spreadsheet
Upload
ListView (Mobile)
ComboBox
TabStrip
MultiSelect
AutoComplete
ListView
Menu
Templates
Gantt
Validation
TreeList
Diagram
NumericTextBox
Splitter
PanelBar
Application
Map
Drag and Drop
ToolTip
Calendar
PivotGrid
ScrollView (Mobile)
Toolbar
TabStrip (Mobile)
Slider
Button (Mobile)
Filter
SPA
Drawing API
Drawer (Mobile)
Globalization
LinearGauge
Sortable
ModalView
Hierarchical Data Source
Button
FileManager
MaskedTextBox
View
Form
NavBar
Notification
Switch (Mobile)
SplitView
ListBox
DropDownTree
PDFViewer
Sparkline
ActionSheet
TileLayout
PopOver (Mobile)
TreeMap
ButtonGroup
ColorPicker
Pager
Styling
MultiColumnComboBox
Chat
DateRangePicker
Dialog
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Effects
Accessibility
PivotGridV2
ScrollView
BulletChart
Licensing
QRCode
ResponsivePanel
Switch
Wizard
CheckBoxGroup
TextArea
Barcode
Breadcrumb
Collapsible
Localization
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
TimePicker
BottomNavigation
Ripple
SkeletonContainer
Avatar
Circular ProgressBar
FlatColorPicker
SplitButton
Signature
Chip
ChipList
VS Code Extension
AIPrompt
PropertyGrid
Sankey
Chart Wizard
OTP Input
SpeechToTextButton
InlineAIPrompt
StockChart
ContextMenu
DateTimePicker
RadialGauge
ArcGauge
AICodingAssistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?