Telerik Forums
Kendo UI for jQuery Forum
3 answers
234 views
Hi guys,

I'm working with kendo upload and I need some clarifications.

After looking around I understood that is not possible to filter file extensions before user imput ( like the old *.pdf). Is it correct?
If it is, could I use an handler on "select" and manually remove the selected file if it not matches the requested extension? how?

second question:
I normally use the upload in async mode, but this time I'd prefer to use it in sync mode.
The problem is that I'm kind of confused..how could I access the selected file's data??

I red on your doc that with sync mode the file is uploaded when the form is submitted...
ok..but where could I find its data? the client-side events are never fired..
I must say that the documentation is quite poor on this topic!

Thanks
Fabio
T. Tsonev
Telerik team
 answered on 29 Aug 2013
2 answers
282 views
Hi.
I'm trying to use  angular-kendo framework and it seems pretty cool!
But I can't to make working treeview...
I use following angular controller:
function HomeCtrl($scope)
{
 $scope.things = {dataSource: [{ name: "Thing 1", id: 1 },{ name: "Thing 2", id: 2 },{ name: "Thing 3", id: 3 }]}
}
and following template:

<div  kendo-treeview   <br>        
k-data-source="things"        
k-data-text-field="'name'" />
But it doesn't work...  While other controls taken from sample angular-kendo framework like grid
work great.

This chunk of code also works:
<div id="treeview"></div>
<script>
$("#treeview").kendoTreeView({
  dataTextField: [ "name"],
  dataSource: [{ name: "Thing 1", id: 1 },{ name: "Thing 2", id: 2 },{ name: "Thing 3", id: 3 }]
});
</script>


What I'm doing wrong?

Thanks in advance.
Jose Mejia
Top achievements
Rank 1
 answered on 29 Aug 2013
4 answers
173 views
I would like to simulate hierarchical multiselect so values from one multiselect efects on values on other one.
So when I click mouse on other multiselect it checks server with values from first multiselect.

I think I know how to set values with param value on second multiselect data source.
But I how to force to re read server when popup is opened?  Like initial autobind = false. But always.

I'm using simple Json request and I cannot use odata  type.
Marcin
Top achievements
Rank 1
Veteran
 answered on 29 Aug 2013
3 answers
64 views
I tried to display the week format format for the current week for my calendar app, but it is not working for having the day start time of 7am. Is there a way to do this? This is my API rendering call:

$scheduler = new \Kendo\UI\Scheduler('scheduler');
$scheduler->timezone("Etc/UTC")
          ->date(new DateTime())
          ->height(600)
          ->addView(array('type' => 'day', 'startTime' => new DateTime('2013/6/13 7:00')),
            array('type' => 'week', 'selected' => true, 'startTime' => new DateTime('2013/6/13 7:00')), 'month', 'agenda')
          ->dataSource($dataSource);

It does show the week of "August 26th", but, it starts to display 1am instead of 7am??

paul
Rosen
Telerik team
 answered on 29 Aug 2013
4 answers
1.0K+ views
How do I go about getting some placeholder text inside the combo so when they click on it or start tying it disappears?

I tried the HTML5 placeholder attribute on the input, but it doesn't seem to work.
Georgi Krustev
Telerik team
 answered on 29 Aug 2013
1 answer
97 views
While Changing the view, fresh data is loaded in grid based on view selection [ Making the ajax call for retrieving the grid data].
Groupby is stop working once fresh data is loaded. [ Not able to drag the column ]

     
function GridBind(urlGetData) {
    $.ajax({
        url: urlGetData,
        dataType: 'json',
        success: function (results) {
               _grid = $("#grid").kendoGrid({
                dataSource: {
                    data: results.Rows  ,
                    pageSize: parseInt($('#DefaultPage').val())
                },
                groupable: true,
                scrollable: true,
                sortable: true,
                filterable: { extra: false },
                pageable: {
                    refresh: true,
                    pageSizes: [10, 20, 30, 40, 50, 100]
                },
                detailTemplate: kendo.template($("#template12").html()),
                detailInit: detailInitDB,
                cache: false,
                resizable: true,
                dataBound: function () {
                    resizeGrid();
                },
                selectable: "multiple",
                change: function () {
                    onSelection();
                },                columns: results.Cols
                });     
                resizeGrid();
            }
        }    });              
Nikolay Rusev
Telerik team
 answered on 29 Aug 2013
3 answers
244 views
Hi Telerik Team,

I am new to Kendo UI charts ( MVC ). Do Kendo charts provide any provision for auto scaling x axis in MVC for column chart ? like I have a large number of values which mess up the chart display.

I want to display dates on x-axis.

Thanks
Pratik
Hristo Germanov
Telerik team
 answered on 29 Aug 2013
1 answer
596 views
Hi, I currently try to tweak the dataSource Read function to load local data instead of using URL.
In my page I got several grid binding to several dataSource (I do not know at loading time because all page is dynamically created). All dataSource take data in one Read function that read an hugde local data array. I need to know witch DataSource (or Grid) call the Read function. But I can't found a way to do this.
Thanks for your help
function CreeDataSourceGroupes() {
    var that = this;
 
    //Pour cahque groupe présent
    $("[id*='Groupe'][data-role='grid']").each(function () {
 
        var groupeID = $(this).attr('Id')
        dsGroupes = new kendo.data.DataSource(
                   {
                       groupId: 'ID1',         // ============= NEED TO READ THIS ID SET WHEN CREATING THE DS
                       transport: {
                           read: function (options) {
                               that.DsGroupeRead(options);
                           }
                       }
                   });
 
     
            $(this).data('kendoGrid').setDataSource(dsGroupes);
    })
}
 
function DsGroupeRead (options, x)
{
 
    // NEED THE GROUP ID HERE
 
    //var data = speakerData1
    //options.success(data);
}
Rosen
Telerik team
 answered on 29 Aug 2013
1 answer
829 views
for following cases
- I am creating grid for Tests if failed then row style color should be read or passed then row style color should be green.
- Another thing is I want to create a runtime column which will be computed result from data
   example Completed is 9 and Total is 20: so I want to create column say Available which will be (20-9)=11

Thanks,
Suhaib
Dimo
Telerik team
 answered on 29 Aug 2013
3 answers
301 views
I've been following the steps outlined here to practice CRUD operations with the Kendo UI Grid:

http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/grid/batch-editing

And the incell editing is not actually saving the data changes I make. I've figured out that I'm running into ModelState errors, and so the ModelState.IsValid flag is false. Here is my edit method:

public ActionResult Editing_Update([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<TestTable> tests)
        {
            var results = new List<TestTable>();
 
            foreach (var modelStateValue in ViewData.ModelState.Values)
            {
                foreach (var error in modelStateValue.Errors)
                {
                    // Do something useful with these properties
                    var errorMessage = error.ErrorMessage;
                    var exception = error.Exception;
                }
            }
 
            if (tests != null && ModelState.IsValid)
            {
                using (var delta = new DeltaHREntities())
                {
                    foreach (var test in tests)
                    {
                        var entity = new TestTable
                        {
                            ID = test.ID,
                            Name = test.Name,
                            DateCreated = test.DateCreated
                        };
 
                        results.Add(entity);//store the test object for later use
                        delta.TestTables.Attach(entity);
                        //delta.Entry(test).State = EntityState.Modified;//why doesn't this work?
                        delta.ObjectStateManager.ChangeObjectState(entity, EntityState.Modified);
                    }
                    delta.SaveChanges();
                }
            }
 
            return Json(results.ToDataSourceResult(request, ModelState, test => new TestTable
            {
                Name = test.Name,
                DateCreated = test.DateCreated,
                ID = test.ID
            }));
        }
The exception that is raised is this:

"The key-value pairs that define an EntityKey cannot be null or empty"

Now the only part of my dataset that is null is the Name column, but this is set to Nullable in the edmx file, and the db field itself is set to nullable. So why do I keep getting this error message?

Another thing I'm confused about is how the demo (see the link above ) says to create a class called ProductViewModel in step 5. Why is this necessary when the Entity Framework has already created a Product table for you automatically? This seems to be an unneeded duplication of data. Thanks.
Daniel
Telerik team
 answered on 29 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?