Telerik Forums
Kendo UI for jQuery Forum
1 answer
81 views

When i am trying to update the value through the join it updated the database but not updating the gridview.
But after refreshing the page it is showing the updated value.
Here is my code.

@(Html.Kendo().Grid(Model)

.Name(

 

"Grid")

 

.Columns(columns =>

{

 

columns.Bound(p => p.RoleTypeName).HtmlAttributes(

 

new { style = "text-align: left" }).Width(90);

 

columns.Bound(p => p.Name).HtmlAttributes(

 

new { style = "text-align: left" }).Width(100);

 

columns.Bound(p => p.Status).HtmlAttributes(

 

new { style = "text-align: center" }).Width(80);

 

columns.Command(command => { command.Edit(); }).HtmlAttributes(

 

new { style = "text-align: center" }).Width(100);

 

})

.Editable(editable => editable.Mode(

 

GridEditMode.PopUp).TemplateName("PopUpTemplate").Window(w => w.Title("Manage Role").Name("editWindow").Width(400).Height(200)))

 

.Pageable(p => p.PageSizes(

 

true))

 

.Sortable()

.Scrollable()

.DataSource(dataSource => dataSource

 

 

//.Server()

 

.Ajax()

.ServerOperation(

 

false)

 

 

.Model(model => model.Id(p => p.RoleID))

.Read(read => read.Action(

 

"ManageRole", "ManageRole"))

 

.Update(update => update.Action(

 

"Update", "ManageRole"))

 

 

)

)

 


and my editor template contains dropdownlist

@(Html.Kendo().DropDownListFor(model => model.StatusName)

.Name(

 

"StatusName")

 

.DataTextField(

 

"StatusName")

 

.DataValueField(

 

"StatusName")

 

.DataSource(source =>

{

source.Read(read =>

{

read.Action(

 

"GetStatus", "ManageRole");

 

});

})

 

)

When i update the status from the dropdownlist updates in data but not show in grid, it appear when refreshing the page.How can i remove this problem please help me out. 

 

Daniel
Telerik team
 answered on 12 Sep 2012
2 answers
181 views
So I'm using MVC3, creating a textbox for the date-time like so:

@Html.TextBoxFor(e => e.EndDtTm, new { id = "endDtTm", style = "width: 200px;" })

and in Ready creating the kendo control

$("#endDtTm").kendoDateTimePicker();

The problem I'm having is that after I load up the model the control shows the date and time correctly but if I click the time icon and pick a new time the date resets to todays date.  The opposite happens if I select the date icon and pick a new date then the time is reset to 12:00 am.

How do I prevent this from happening?
Georgi Krustev
Telerik team
 answered on 12 Sep 2012
2 answers
5.3K+ views
When i set the value for the datepicker programatically, the change event does not fire. The basic code is below:



                $("#datePicker").kendoDatePicker({
                    change: function (e) {
                        selectedDate = $("#datePicker").data("kendoDatePicker").value();
                        console.warn(selectedDate);
                    }
                });
$("#datePicker").data("kendoDatePicker").value(selectedDate);
Georgi Krustev
Telerik team
 answered on 12 Sep 2012
2 answers
554 views
Is it possible to format numbers based on variable rather than fixed values? I know that there are various ways you can
do this normally, like padding etc but is it possible to do something directly in the grid?

This is very important btw.
Marcus
Top achievements
Rank 1
 answered on 12 Sep 2012
0 answers
130 views

Hi

I have:
 
1. The table of the Program of training
2. The table courses
3. Questionnaires ( Of this table is construction CHART)
 
I want to construct Cascading ComboBox in which selecting programs of training and then courses. After a selection of course, making data from table Questionnaires and construction Chart

How to connect Chart at the first start of page when still it is not known on what identifier to select the data from the table

See my code.

How it to make?

 

 

 

Leonid
Top achievements
Rank 1
 asked on 12 Sep 2012
5 answers
957 views
I previously used the Telerik MVC combobox control so that it only returns results when at least 3 characters have been entered. I was able to specify this in my controller by simple checking the text string that was passed in the ajax request.

With the KendoUI combobox, I cannot figure out how the text is being passed and what to check for in my controller to see if at least 3 characters have been entered.

Can you provide any assistance with this? Thanks.

UPDATE:

So I found by looking at the AutoComplete control, that I can set the ComboBox to not retrieve results until at least 3 characters are entered by using minLength: 3

I still have the issue on the controller side, however, that I don't want to bring back the entire list...I only want to bring back results that contain the text entered. What do I need to include on the controller side to get the text entered in the ComboBox?

Thanks!
Ryan Lege
Top achievements
Rank 1
 answered on 12 Sep 2012
0 answers
105 views
Hi,

I'm loading the content of a window by using the refresh method with a URL. Is there a way to find out which URL the content was really fetched from (if it is redirected)?

I know that I could just check the content and look for some unique element to discern which page was loaded if I know the content, but this is not always feasible.
Nocklas
Top achievements
Rank 1
 asked on 12 Sep 2012
5 answers
222 views
Hi,

A seconde question about the DataSource is how can we get the Data of a subset into f.i. a grid. Here's the code we use for our JSON services.

[DataContract]
public partial class VMProject : VMRoot
{
public VMProject() {}
public static VMProject GetById(object sender, int id)
{
return CallGetVMById<VMProject>("", id);
}
public static VMEntitySet<VMProject> AllVMProjectList(object sender)
{
return (VMEntitySet<VMProject>)CallGetVMAllList<VMEntitySet<VMProject>>(sender);
}
[DataMember]
public String Name
{
get { return CallGetData<String>("Name"); }
set { CallSetData ("Name", value); }
}
[DataMember]
public VMEntitySet<VMProjectRegel> ProjectRegelList
{
get { return CallGetData<VMEntitySet<VMProjectRegel>>("ProjectRegelList"); }
// set { CallSetData ("ProjectRegelList", value); }
}
}

The consumed class VMRoot looks like this:
[DataContract]
public partial class VMRoot : Viewmodel
{
public VMRoot() {}
public static VMRoot GetById(object sender, int id)
{
return CallGetVMById<VMRoot>("", id);
}
public static VMEntitySet<VMRoot> AllVMRootList(object sender)
{
return (VMEntitySet<VMRoot>)CallGetVMAllList<VMEntitySet<VMRoot>>(sender);
}
[DataMember]
public Int32 Id
{
get { return CallGetData<Int32>("Id"); }
set { CallSetData ("Id", value); }
}
[DataMember]
public DateTime CreatedOn
{
get { return CallGetData<DateTime>("CreatedOn"); }
set { CallSetData ("CreatedOn", value); }
}
[DataMember]
public Int32 CreatedBy
{
get { return CallGetData<Int32>("CreatedBy"); }
set { CallSetData ("CreatedBy", value); }
}
[DataMember]
public DateTime ChangedOn
{
get { return CallGetData<DateTime>("ChangedOn"); }
set { CallSetData ("ChangedOn", value); }
}
[DataMember]
public Int32 ChangedBy
{
get { return CallGetData<Int32>("ChangedBy"); }
set { CallSetData ("ChangedBy", value); }
}
}

The VMEntitySet is an ObservableCollection which contains VMProjectRegel objects. These are defined like so:
[DataContract]
public partial class VMProjectRegel : VMRoot
{
public VMProjectRegel() {}
public static VMProjectRegel GetById(object sender, int id)
{
return CallGetVMById<VMProjectRegel>("", id);
}
public static VMEntitySet<VMProjectRegel> AllVMProjectRegelList(object sender)
{
return (VMEntitySet<VMProjectRegel>)CallGetVMAllList<VMEntitySet<VMProjectRegel>>(sender);
}
[DataMember]
public Int32 Aantal
{
get { return CallGetData<Int32>("Aantal"); }
set { CallSetData ("Aantal", value); }
}
[DataMember]
public Decimal Prijs
{
get { return CallGetData<Decimal>("Prijs"); }
set { CallSetData ("Prijs", value); }
}
[DataMember]
public Decimal BTW
{
get { return CallGetData<Decimal>("BTW"); }
set { CallSetData ("BTW", value); }
}
}

The JSON we receive looks like this:
[
{
"DatumAanvang": "\/Date(1345732135057+0200)\/",
"DatumFaktuur": "\/Date(1345732135059+0200)\/",
"Name": "Project onderhoud",
"ProjectRegelList": [
{
"Aantal": 99,
"Prijs": 99.000000000000,
"BTW": 1.000000000000,
"Id": 101,
"CreatedOn": "\/Date(1345732135085+0200)\/",
"CreatedBy": 10,
"ChangedOn": "\/Date(1345732135085+0200)\/",
"ChangedBy": 10
}
],
"Id": 1,
"CreatedOn": "\/Date(1345732135060+0200)\/",
"CreatedBy": 10,
"ChangedOn": "\/Date(1345732135060+0200)\/",
"ChangedBy": 10
}
]

The DataSource is defined like so:

var dataSourceprojecten = new kendo.data.DataSource(
{
// the transport tells the datasource what endpoints
// to use for CRUD actions
schema:
{
model:
{
id: "Id",
fields:
{
DatumAanvang:
{
type: "date"
},
DatumFaktuur:
{
type: "date"
},
Name:
{
type: "string"
},
CreatedOn:
{
"type": "date"
},
CreatedBy:
{
"type": "number"
},
ChangedOn:
{
"type": "date"
},
ChangedBy:
{
"type": "number"
}
}
}
},
transport:
{
read:
{
url: "../api/projectonderhoud/get",
dataType: "json"
}
}
});

after executing the dataSourceprojecten.read() the data is available for the main list but how do we specify the fetch for the ProjectRegelsList in f.i. a grid?

This is what I have tried (among many other attempts) to get it to work:

                      $("#projectregels").kendoGrid(
                {
                    dataSource:
                    {
                    schema:
                    {
                        model: ProjectRegel
                    },
                    data: dataSourceprojecten.ProjectRegelList
                    },                       
                    groupable: true,
                    sortable: true,
                    pagesize: 10,
                    columns:
                    [
                        {
                            field: "Id",
                            title: "Id"
                        },
                        {
                            field: "Aantal",
                            title: "Aantal"
                        },
                        {
                            field: "Prijs"
                        },
                        {
                            field: "BTW"
                        },
                        {
                            field: "CreatedOn",
                            title: "Created on",
                            template: '#= kendo.toString(CreatedOn,"dd MM yyyy") #'
                        },
                        {
                            field: "CreatedBy"
                        }
                    ]
                });


Regards
Paul

Atanas Korchev
Telerik team
 answered on 12 Sep 2012
5 answers
215 views
Hi! 
I'm new in Kendo Mobile, but I didn't found the answer on simple from my point of view question: why listview in mobile application does not proper rendered from template? Not listview items, but the whole listview, for example:
<div data-role="view" id="foo" data-model="dataSource">
    <div data-template="t1" data-bind="source: this"></div>
</div>
 
<script id="t1" type="text/x-kendo-template">
   <ul data-auto-bind="false" id="listview" data-role="listview" >
       <li>aaa</li>
       <li>bbb</li>
    </ul>
</script>

if I place <ul> in main div, it works, suppose I do something wrong, please help
Alexander Valchev
Telerik team
 answered on 12 Sep 2012
0 answers
336 views
I try to make a single page web app. It will contain some grids and forms. Some of the form controls and grids are based on the same datasource. Sometimes I need to get a specific item from the datasource (identified by a parameter) or sometimes I just need every available item from the datasource.

I've solved this problem by adding a parameterMap to the transport of the datasource. Now I'm able to exactly retrieve all items from the datasource, how and when I want. For code example, see rootDatasource below.

In the widgets which I'm using, like Grid, I want to call the read method of the datasource with a parameter specified to retrieve all items from the back-end which match the query 'active' == true. See code example:

// create the grind containing the update elements
$("#root_grid").kendoGrid({
    dataSource: rootDatasource.read({ params: { active: true } }),
    columns: [{
            field: "id",
            title: "id",
            width: 80,
        }, {
            field: "name",
            title: "naam",
        }, {
            field: "value",
            title: "weging",
            width: 100,
        }, {
            field: "active",
            title: "actief",
            width: 100,
        }],
    toolbar: [{
            name: "create",
            text: "voeg nieuwe rij toe",
        }, {
            name: "save",
            text: "opslaan",
        }, {
            name : "cancel",
            text: "annuleren",
        }],
    sortable: true,
    pageable: {
        refresh: true,
        pageSizes: true,
        messages: i18n.grid.message
    },
    sortable: {
        mode: "multiple",
        allowUnsort: true
    },
    editable: true,
});

And now my problem, this won' work!! I'm really confused, if I just add a reference to the datasource object without directly specifying the .read() method, it just works. (Retrieving all items, including 'active' == false though.) In another form I want to specify some other parameters, so just adding the parameters to my (PHP) back-end just doesn't work.

I've been reading the docs en forums quite extensively to find an answer, didn't find it and I find myself quite stuck right now. Any help will be much welcome. 

var rootDatasource = new kendo.data.DataSource({
 
    schema: {
        data: "data",
        model: Root,
        total: function(response) {
            return $(response.data).length;
        }
    },
     
    pageSize: 10,
 
    transport: {
         
        read: "/vta/root/all.json",
         
        update: {
            url: "/vta/root/update.json",
            type: "POST"
        },
         
        create: {
            url: "/vta/root/create.json",
            type: "PUT"
        },
 
        parameterMap: function (data, operation) {
 
            if (operation == "read") {
 
                if (data.params != undefined) {
 
                    var params = new Array();
                     
                    for (var n in data.params) {
                        params.push(n +"="+ data.params[n]);
                    }
                     
                    return params.join('&');
                     
                }
                 
            }
             
        }
                                         
    },
     
    error: function(e) {
        alert(e.responseText);
    },
     
    change: function(data) {
//      console.log(data);
    },
     
    sort: {
        field: 'id',
        dir: 'asc'
    }
             
});

var Root = kendo.data.Model.define({


    id: "id",
    
    fields: {
        
        id: {
            editable: false
        },
        
        name: { 
            type: "string",
            validation: { 
                required: true
            } 
        },
        
        'value': {
            type: "number",  
        },
        
        active: { 
            type: "boolean",
        }
    },




});
Jeroen
Top achievements
Rank 1
 asked on 12 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
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?