Telerik Forums
Kendo UI for jQuery Forum
4 answers
387 views

How do I grab items beyond the currently defined "$('#listview').data('kendoMobileListView').dataSource.data()"?

I'm writing a feature to do a batch action with selected items of a mobile listview. The kendo.data.Datasource has data loaded in remotely, and we define the following:

serverPaging: true,
pageSize: 10

The schema.total in my test case is 55. Each dataItem has a property 'Select' that has defaultValue: undefined, and is set to true/false defined by whether user selects or de-selects the item on click. I want to avoid having to create a list to hold objects and add/remove items based on whether a user selects/deselects said items, which is why i wanted to just toggle this property back and forth on click. I want the user to be able to scroll through all 55 items and select items as desired. I also want to do a 'select all' feature where the all items on the listview are selected/deselected and also allow individual toggling post 'select/de-select all' with the same 'Select' property modification in mind. Then only when the user selects to do the batch action, detect all dataItem's Select value and send those items to the function that handles the batch action.

My observations (correct me if I'm wrong):

(var dataItemList = $('#listview').data('kendoMobileListView').dataSource.data() for the purpose of brevity)

1)  dataItemList is redefined every 1/2 pageSize. So initial list is dataItemList[0] thru dataItemList[9], then next time it is defined (the return value of $('#listview').data('kendoMobileListView').dataSource.data()), it's dataItemList[5] thru dataItemList[14] (obviously where dataItemList[5] is at index 0 and dataItemList[14] is at index 9 of the new list), and so on...

2) property modifications of an item in dataItemList are retained, even after dataItemList is redefined. This leads me to believe all items in the datasource are saved somewhere and I just don't know how to access it. For example if i set dataItemList[0].Select = true, then scroll to a point on the list where dataItemList[0] isn't on dataItemList, then scroll back (so I can read it's properties), dataItemList[0].Select == true versus the default 'undefined' value.

3) I can save items to a manually generated object with key-value pair and use the key to remove or add the object to the list when a click is detected, or if the 'select all' button is clicked, load in new items to the list with itemChange event, but this will be a clumsy implementation at best for the manual select/deselect functionality post-'select all' for items outside of ones currently represented by dataItemList.

To clarify on my question:

I want to access those dataItems on the kendoMobileListView that aren't returned by dataSource.data(), but I have to keep virtual scrolling and the datasource is loaded from a remote source. Is this possible? If so, how?

Let me know if you need further clarification/example. Thanks in advance.

Gary
Top achievements
Rank 1
 answered on 24 May 2017
1 answer
191 views

Hello,

I have a grid that supports a model.  But I want to generate different columns renderings depending on a value selected.
eg.
One time the value column needs to be a text box, numeric text box, color selector.

I've managed to do so with everything in java script.  But now I want to move the column definition into my database and return a json array butI'm facing one problem and that is the editor property.

The grid is generated if I leave all the editor properties empty.  But when I want to use one the grid isn't generated and I'm not getting any javascript errors.
(The editors exists)

This is what my service is returning:
[{"field":"ValidFrom","title":"Valid from","width":"75px","format":"{0:dd/MM/yyyy}"},{"field":"ValidTo","title":"Valid to","width":"75px","format":"{0:dd/MM/yyyy}"},{"field":"Item","title":"Retailer loyalty score","width":"125px"},{"field":"Value","title":"Color","width":"75px","editor":colorEditor,"template":"<div style='background-color: #=Value#;'>&nbsp;</div>"},{"field":"RangeMin","title":"Min score","width":"75px"},{"field":"RangeMax","title":"Max score","width":"75px"},{"field":"Active","title":"Active","width":"50px","editor":customActiveEditor,"attributes":{"style":"text-align: center"},"template":"<div align=center><input style=\"display:none;\" id=\"Active_#=RuleID#\"   type=\"checkbox\" #= Active ? \"checked='checked'\" : '' # class=\"k-checkbox chbxItem\"  /><label class=\"k-checkbox-label\" for=\"Active_#=RuleID#\"</label></div>\r\n"}]

 

Tsvetina
Telerik team
 answered on 23 May 2017
3 answers
494 views
Hi,

I want to update the map markers on a click event but I can't find a way of binding them to the markers object:

@(Html.Kendo().Map()
.Name("map")
.Center(51.514198, -0.093100)
.Zoom(15)
.Layers(layers =>
{
layers.Add()
.Type(MapLayerType.Tile)
.UrlTemplateId("http://tile2.opencyclemap.org/transport/#= zoom #/#= x #/#= y #.png")
.Subdomains("a", "b", "c")
.;

layers.Add()
.Type(MapLayerType.Marker)
.DataSource(dataSource => dataSource
.Read(read => read.Action("RefreshChart", "Map").Data("additionalInfo"))
)
.LocationField("LongAndLot")

.TitleField("Title")
.Tooltip(tool => tool.ShowOn(TooltipShowOnEvent.Click).Events(e => e.Show("onClick")));


})
)


Ajax call:

var dataSource = new kendo.data.DataSource({
transport: {
read: function (options) {
$.ajax({
type: "POST",
url: controllerName + '/RefreshChartAjax',
contentType: "application/json; charset=utf-8",
dataType: 'json',
data: JSON.stringify({ country: country, startDate: startDate, endDate: endDate, groupedBy: groupedBy }),
success: function (data) {
options.success(data);
}
});
}
}
}); 

$("#map").kendoMap({ dataSource: dataSource });?????

How do I bind the dataSource to the Layers/Markers object?

Thanks!
Preslav
Telerik team
 answered on 23 May 2017
3 answers
471 views
I'd like to be able to freeze some rows into the top and bottom of the scrolling area (so they don't scroll with the other rows). How would you go recommend going about that? I've tried a few different things, but they've all involved a lot of extra work to fix other features of the grid.
Boyan Dimitrov
Telerik team
 answered on 23 May 2017
3 answers
518 views

Hi,

I use the following Code "grid.expandRow(grid.tbody.find("tr.k-master-row"));" to expand all rows and it works but it takes some time ( a few seconds)

so I thought I use kendo.ui.progress to show the grid progress indicator during the expansion - but this doesn't work...
what I'm doing wrong?
how to show the progress indicator from/in the grid if a longer progress is taken place?
robert

var grid = $("#grdStandort").data("kendoGrid");
kendo.ui.progress($("#grdStandort"), true);
grid.expandRow(grid.tbody.find("tr.k-master-row"));
kendo.ui.progress($("#grdStandort"), false);
Tsvetina
Telerik team
 answered on 23 May 2017
3 answers
1.4K+ views

Hi, I am kind of new in Kendo UI for Angular 2 and i wish to call a web service when a Tab is selected so i can fetch data to fill in the Tab Contents.

Is there a way to call or invoke a method when a Tab is selected?

Petyo
Telerik team
 answered on 23 May 2017
5 answers
393 views

I'm attempting to build a template for days in `month` view using view.dayTemplate. The reason I'm doing this is so that I can add a piece of text at the top right of each day showing the number of tasks in that day. Is there a method of accessing the number of events listed for a given day?

Here is my desired template:

<script id="monthview-day-template" type="text/x-kendo-template">
    <span><span data-bind="text: <event-count-here>"></span> Tasks</span>
</script
Ivan Danchev
Telerik team
 answered on 23 May 2017
1 answer
530 views

Do we need to use kendo.common.css before kendo.default-v2.css ?

Because when I use them there are many bugs...

Simple example on screenshot.

Ivan Zhekov
Telerik team
 answered on 23 May 2017
7 answers
846 views

I've set columns editor for the column "itpt_name" but after grid.setOptions it is broken

Here is the example http://dojo.telerik.com/EjIlI

You need to follow these steps to reproduse

1) Open http://dojo.telerik.com/EjIlI

2) Click "Run"

3) Double click in any Cell in column "Партия" (you can see working custom editor with the broken images, it is normal)

4) Set sorting for the column "Партия"

5) Save state using "Save state" button

6) Ctrl+F5

7) Load saved state

8) Double click in any Cell in column "Партия" (custom editor is broken, it is not normal)

 Please advise why custom editor is broken

Frédéric.R
Top achievements
Rank 1
 answered on 23 May 2017
5 answers
244 views

Hello

Is it possible to toggle panel also when visible (wide screen). Running manually close/open is not doing anything. And I would like to be able close (manually) panel, then show it, also on wide screen.

Dimiter Topalov
Telerik team
 answered on 23 May 2017
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
Chat
MultiColumnComboBox
Dialog
DateRangePicker
Checkbox
Timeline
Drawer
DateInput
ProgressBar
MediaPlayer
ImageEditor
TextBox
OrgChart
Accessibility
Effects
PivotGridV2
Licensing
ScrollView
Switch
TextArea
BulletChart
QRCode
ResponsivePanel
Wizard
CheckBoxGroup
Localization
Barcode
Breadcrumb
Collapsible
MultiViewCalendar
Touch
RadioButton
Stepper
Card
ExpansionPanel
Rating
RadioGroup
Badge
Captcha
Heatmap
AppBar
Loader
Security
TaskBoard
Popover
DockManager
TimePicker
FloatingActionButton
CircularGauge
ColorGradient
ColorPalette
DropDownButton
TimeDurationPicker
ToggleButton
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
SmartPasteButton
PromptBox
SegmentedControl
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?