Telerik Forums
Kendo UI for jQuery Forum
0 answers
310 views
Hi...I saw some examples on the internet regarding data binding using json in ListView but those things are not working in my case. I have a Controller named "Contact" and there is method named "Read", in Read () method I get the Contact list which I want to show in ListView in Mobile. Here is my View Code...


<div data-role="view" id="tabstrip-profile" data-title="Dashboard" data-layout="mobile-tabstrip"
    data-init="initListView">
    <ul data-role="listview" data-style="inset" data-type="group">
        <li>
            <ul id="contactList">
            </ul>
        </li>
    </ul> 

</div>
<script type="text/javascript">
var deviceJDS = new kendo.data.DataSource({
            transport: {
                read: {
                    contentType: "application/json; charset=utf-8",
                    type: "GET",
                    data: "{}",
                    dataType: "json",
                    url: "/Contact/Read"
                }
            },
            schema: {
                data: "d" 
            }
        });


        function initListView(e) {
            e.view.element.find("#contactList").kendoMobileListView({
template: "<strong>#:data.DisplayName#</strong>",
            dataSource: deviceJDS
            });

}

var app = new kendo.mobile.Application(document.body);

</script>
Mayank
Top achievements
Rank 1
 asked on 21 Sep 2012
2 answers
158 views
I have a following scenario: Mobile view renders blocks of data based on view model array using MVVM and templating.
I have also add and remove button to add and remove elements to/from array.

To reproduce my issue:
1. Suppose you have 3 elements that fit in your mobile view complete, so scrolling is not needed. (screenshot_1)
2. Push "Add" button and forth element appears on mobile view, scrolling now is active, scroll down to see buttons (screenshot_2)
3. Push "Remove" button, last element is removed from DOM, but view remains "scrolled" and the worst is - I could not scroll it up (screentshot_3)

Is it possible somehow to scroll view back? After some clicks It goes back, but on iPad I could not do anything, it stays as "scrolled up".

I prepared fiddle, I can this reproduce on Windows / Chrome, and iPad also, see also screenshots
http://jsfiddle.net/KuYTL/18/ 

Alex
Top achievements
Rank 1
 answered on 21 Sep 2012
0 answers
228 views
Hi,

I am a new programmer with Kendo UI on MVC, I have a question to ask supporter.
I am using Kendo Grid call popup window when I edit button click like code below :

@(Html.Kendo().Grid<tblAttachFile>()
    .Name("tblAttachFile")
    .BindTo(Model.tblAttachFiles)
    .Columns(col =>
    {
        col.Bound(p => p.Attach_File_Name).Title("File Name");
        col.Bound(p => p.Attach_File_Path).Title("File Path");
        col.Bound(p => p.Attach_File_Description).Title("File Description");
        col.Command(cmd => cmd.Edit());
    })
        //.ToolBar(toolbar => toolbar.Create())
    .Editable(ed => ed.Mode(GridEditMode.PopUp).Window(w => w.Name("winEdit").Title("My Test").Content("Loading").LoadContentFrom("Edit", "AttachFile", new { id = 1 })))
    .Pageable()
    .Sortable()
    .Scrollable()
    .DataSource(ds => ds
        .Server()
        .Model(m => m.Id(p => p.Attach_File_ID))
        .Update("Edit", "AttachFile")
        )
)

I want to get Attach_File_ID in to route value in this line 
.Editable(ed => ed.Mode(GridEditMode.PopUp).Window(w => w.Name("winEdit").Title("My Test").Content("Loading").LoadContentFrom("Edit", "AttachFile", new { id = Attach_File_ID })))
When I enter id number like (1, 2, 3) it is work correct.

How can I get dynamic ID in route value ?

This code below is my controller that I want to do :
// GET: /tblAttachFiles/Edit/5
[Authorize]
public ActionResult Edit(int id)
{           
    tblAttachFile tblattachfile = tblattachfileRepository.GetOne(id);
    ControllerHelper.filePath = tblattachfile.Attach_File_Path;
    return View(tblattachfile);
}
 
//
// POST: /tblAttachFiles/Edit/5
 
[AcceptVerbs(HttpVerbs.Post), Authorize]
public ActionResult Edit(int id, FormCollection collection)
{
    tblAttachFile tblattachfile = tblattachfileRepository.GetOne(id);
    try
    {
        tblattachfile.Attach_File_Path = ControllerHelper.filePath;
        ControllerHelper.filePath = "";
 
        tblattachfile.Updated_Date = DateTime.Now;
        tblattachfile.Updated_By = User.Identity.Name;
 
        UpdateModel(tblattachfile);
        tblattachfileRepository.Save();
        return RedirectToAction("Detail", new { id = tblattachfile.Attach_File_ID });
    }
    catch
    {
        ModelState.AddRuleViolations(tblattachfile.GetRuleViolations());
        return View(tblattachfile);
    }
}

Thank advanced,
Sorry For my bad English !
KHUN
Khieu Kim Khun
Top achievements
Rank 1
 asked on 21 Sep 2012
1 answer
177 views
I'm testing my new Kendo Upload tool in an MVC site. I've found in our XP QA machine, using any version of IE, I'm not able to upload any images (I've set to only allow .jpg). I get a permission denied error in my XMLHttpRequest response.

I believe this is because we're showing the MVC site inside of an iframe of another site, and we're getting some kind of cross-domain issue. However if this were the case, would it only be happening in an XP environment, or all of them? Does anyone know enough about Kendo to point me in the right direction?

    @(Html.Kendo().Upload()
        .Name("images")
        .Async(async => async
            .Save("Save", "Upload")
            .Remove("Remove", "Upload")
            .AutoUpload(true)
        )
        .Events(events => events
            .Select("onSelect")
            .Remove("onRemove")
            .Error("onError")
            .Upload("onUpload")
            .Success("onSuccess")
        )
    )
T. Tsonev
Telerik team
 answered on 21 Sep 2012
1 answer
131 views

Dear Kendo support team,

I use Kendo UI grid within a Bootstrap Responsive Layout and  would like to add 2 items to the grid's column menu.

One for increasing the current column width by a certain amount and one for the shrinking the width. Ideally I would like to have an icon as menuitem.

Please give me some advise how to manage this.

Thank you in advance

Petur Subev
Telerik team
 answered on 21 Sep 2012
2 answers
137 views
Hello,

I use kendo-ui datasource and grid with the SharePoint 2010 list odata service. I need to enable batch editing. As mentioned in this article:

http://msdn.microsoft.com/en-us/library/ff798339

the SharePoint 2010 list odata service supports batching though multipart mime messages. It appears kendo ui does batching by sending accross a request per operation type update/destroy/create (in what order?), where each request contains a collection of the objects involved, which requires a parameterMap as follows:

                parameterMap: function (options, operation) {
                    if (operation !== "read" && options.models) {
                        return { models: kendo.stringify(options.models) };
                    }
                }

Does kendo ui support the multipart mime message way of doing batching?

cheers

Remco 
Remco
Top achievements
Rank 1
 answered on 21 Sep 2012
6 answers
840 views
Is it possible in the grid to select multiple rows and edit them as 1? So can I select 20 rows and with one click set some value to true?

Nohinn
Top achievements
Rank 1
 answered on 21 Sep 2012
0 answers
273 views
Hi All,
The list of elements shown in a listview are not getting paged depending on the no. entered in the code in cshtml.
For example :

@(Html.Kendo().ListView<Kendo.Mvc.Examples.Models.ProductViewModel>(Model)
    .Name("listView")
    .TagName("div")
    .ClientTemplateId("template")
    .DataSource(dataSource => {
        dataSource.Read(read => read.Action("Products_Read", "ListView"));
        dataSource.PageSize(12);
    })
    .Pageable()        
)

Though we mention 12 in the pagesize, I am getting all my records to the view. Please help how to show the no. of
records as per our choice.


Regards,
Rohit


Rohit
Top achievements
Rank 1
 asked on 21 Sep 2012
3 answers
1.3K+ views
Hi,

How do I prevent dataSource from making request to server?
I have a costly set of data and so stored the JSON in client cache (local storage), so that even after the user navigate away from the page and back, already read data from server would be available rather than making another call to receive same data back again.

I am using local cache to store the data once read from server and want to prevent dataSource from making subsequent request when found in cache.

I tried the following, but it did not work, is there anyway to achieve this?

    var ds = new kendo.data.DataSource({
        transport: {
            read: {
                url: 'url to get data',
                dataType: "json"
            }
        },
        change: OnDataChange,
        requestStart: OnDataRequestStart
    });
 
function OnDataChange(e) {
    if (IsDataRequested) {
        // save it to cache
        $.jStorage.set("LargeData", e.sender.data());
        IsDataExists = true;
        IsDataRequested = false;
    }
}
 
function OnDataRequestStart(e) {
    if (IsDataExists) {
        e.preventDefault();
    }
    else {
        // Check if "key" exists in the storage
        var value = $.jStorage.get("LargeData");
        if (value) {
            IsDataExists = true;
            e.preventDefault();
            e.sender.data(value);
        }
        else {
           // Read data from server
            IsDataRequested = true;         }     } }

Thanks
Muthu
Alexander Valchev
Telerik team
 answered on 21 Sep 2012
6 answers
501 views
Hello,

I'm trying to use Kendo UI with a MVC 4 app but I get the following error:

Object doesn't support property or method 'on'

I've tried including the jquery.min.js that comes with Kendo but it still does not work. MVC uses jQuery v 1.6.2 by default.  I've also tried removing the 1.6.2 reference and using the 1.7.1 (aka jquery.min.js that comes with Kendo), but that too causes other code to fail.  Any suggestions would be appreciated.

- Rashad
Rashad Rivera
Top achievements
Rank 1
 answered on 21 Sep 2012
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
ScrollView
Switch
TextArea
BulletChart
Licensing
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
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
SegmentedControl
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?