Telerik Forums
Kendo UI for jQuery Forum
1 answer
6.1K+ views
Hi,

I want to clear Grid data items but since grid is enabled for sorting and searching when any operation Sort/Search is performed the Data is getting back to grid.

 Can any one help how to tackle this situation.

I am clearing the data-source data items by  $("#Grid").data("kendoGrid").dataSource.data([]);

Thanks,
Chatrapathi chennam

Dimo
Telerik team
 answered on 17 Jul 2014
3 answers
238 views
I have two KendoGrids on my page and i want to bind values to KendoQRCode if some values are editing or was added 

@(Html.Kendo().Grid(Model)
   .Name(ProdGrid")
   .Columns(columns =>
   {
       columns.Bound(p => p.Title);
       columns.Bound(p => p.FirstName);
       columns.Bound(p => p.MiddleName);
       columns.Bound(p => p.FamilyName);
       columns.Command(command => { command.Edit()});
   })
    .Editable(editable => editable.Mode(GridEditMode.InLine))
   .DataSource(dataSource => dataSource.Ajax()
       .Model(model =>
       {
           model.Id(p => p.ID);           
       })
       .Read(read => read.Action("PDetails", "Prod"))
       .Update(update => update.Action("EditingP", "Card"))
   )
                    )
@(Html.Kendo().Grid(Model)
        .Name("Phone")
    .Columns(columns =>
    {
        columns.Bound(p => p.PhoneNumber);
        columns.Command(command => { command.Edit().HtmlAttributes(new { id = i + "EditTel" }); });
    })
     .ToolBar(toolbar => toolbar.Create())
     .Editable(editable => editable.Mode(GridEditMode.InLine))
    .HtmlAttributes(new { style = "width:50%; float:left" })
    .DataSource(dataSource => dataSource.Ajax()
            .Model(model =>
            {
                model.Id(p => p.ID);
 
            })
            .Create(update => update.Action("CreatePhone", "Card", new { id = @i }))
        .Read(read => read.Action("CardPhone", "Card"))
        .Update(update => update.Action("EditingPhone", "Card", new { id = @i }))
    )
)
<div id="example" >
                <div class="configuration-horizontal" id="qrConfig">
                    <div class="config-section">
                        <div>
                            <input id="qrPhone" class="k-textbox" data-bind="value: qrPhone">
                        </div>
                        <br />
                        <div>
                            <textarea id="qrValue" class="k-textbox" data-bind="value: qrValue" rows="5" cols="20"></textarea>
                        </div>
                    </div>
                    <div class="config-section">
                        <span class="configHead">Options</span>
                        <ul class="options">
                            <li>
                                <label for="errorCorrection">Error correction level:</label>
                                <select id="errorCorrection" data-role="dropdownlist" data-bind="value: qrOptions.errorCorrection">
                                    <option value="L">L</option>
                                    <option value="M">M</option>
                                    <option value="Q">Q</option>
                                    <option value="H">H</option>
                                </select>
                            </li>
                            <li>
                                <label for="encoding">Encoding:</label>
                                <select id="encoding" data-role="dropdownlist" data-bind="value: qrOptions.encoding">
                                    <option value="ISO_8859_1">ISO_8859_1</option>
                                    <option value="UTF_8">UTF_8</option>
                                </select>
                            </li>
                            <li>
                                <label for="size">Size:</label>
                                <input id="size" data-bind="value: qrOptions.size" data-role="numerictextbox"
                                       data-format="n0" data-decimals="0" />
                            </li>
                            <li>
                                <label for="borderWidth">Border width:</label>
                                <input id="borderWidth" data-bind="value: qrOptions.border.width" data-role="numerictextbox"
                                       data-format="n0" data-decimals="0" />
                            </li>
                        </ul>
                    </div>                  
                </div>
                 
                <script type="text/javascript">
                    $(document).ready(function () {
                        var qrCode = $("#qrCode").kendoQRCode({
                            size: 200
                        }).data("kendoQRCode");
 
                        var viewModel = kendo.observable({                          
                            qrPhone: 5454
                            qrValue: "HaLo World",
                            qrOptions: {
                                errorCorrection: "L",
                                encoding: "ISO_8859_1",
                                background: "#FFFFFF",
                                color: "#000000",
                                size: 200,
                                border: {
                                    color: "#FFFFFF",
                                    width: 0
                                }
                            },
                            
                            setValue: function () {
                                qrCode.value(this.qrValue + '\n' + this.qrPhone:);
                            },
                            setElementWidth: function () {
                                qrCode.element.width(this.qrOptions.size);
                            }
                        });
 
                        viewModel.bind("change", function (e) {
                            if (e.field == "qrPhone") {
                                this.setValue();
                            }
                            if (e.field == "qrValue") {
                                this.setValue();
                            }
                            else {
                                this.setElementWidth();
                                qrCode.setOptions(this.qrOptions.toJSON());
                            }
                        });
 
                        kendo.bind($("#qrConfig"), viewModel);
                        viewModel.setElementWidth();
                        viewModel.setValue();
                    });
 
                </script>


with input fields works it well, but i want to bind values from Grids after editing or after I add one more Phone to the Table 
Daniel
Telerik team
 answered on 17 Jul 2014
1 answer
120 views
Hi,

we are building a phonegap application with KendoUI, and now there is a requirements that we need do a imessage like chat functionality in this app.
so doese anyone have such experience to build the such chat application UI with   Kendo Mobile UI ?


Thanks, 
Qiu,Juan
Kiril Nikolov
Telerik team
 answered on 17 Jul 2014
4 answers
552 views
on the OnUpload, I can validate that I have set a description textbox, but it will clear my current file selected.  Anyway to keep my current file?


        function onUpload(e) {

            var files = e.files;
            var description = $.trim($("#fileDescription").val());
            if (description.length < 1) {
                alert("Must have a description")
                e.preventDefault();

                    return;
            }
Dimiter Madjarov
Telerik team
 answered on 17 Jul 2014
1 answer
161 views
I've put the following into your sample remote-data-binding.html:

<script>
$.getJSON(http://localhost:60084/....., function (data) {
tree = $("#treeview").kendoTreeView({
dataSource: kendo.observableHierarchy(data)
}).data("kendoTreeView");
});

</script>

Everything else untouched. When I refresh, the browser won't even try to access the url.
I also put some json in a local file, using id, text and items tags on my data, exactly as you advised in http://stackoverflow.com/questions/13286874/kendo-ui-treeview-and-json
if I use the file name instead of the url the page seems to access the file, but the tree is not loaded.

What am I missing?
Alex Gyoshev
Telerik team
 answered on 17 Jul 2014
7 answers
867 views
Hi,

I've tried to reproduce my issue in jsFiddle: http://jsfiddle.net/4uCHx/7/

With Firefox & Chrome, this example will work fine. In IE, you'll get an access denied error. What we're seeing however is that our drop down lists will create, and expand when clicked on, but if you try and click on the scroll bar on the drop down and scroll down the list of options, then list will just close.

The strange thing is that the drop down does actually work on IE7 and IE8, it's just IE9 that we're seeing the problem.

Any ideas?
Georgi Krustev
Telerik team
 answered on 17 Jul 2014
1 answer
1.0K+ views
Basically I am trying to implement server side filtering and sorting but when i am setting this to server side it is working fine but page number in grid not showing also next page , previous page and total Item is not showing up.
here us how i am intialising the grid. 
<script>
        $(document).ready(function () {
            $("#grid").kendoGrid({
                columns: [
                            { field: "TicketID", title: "Id", filterable: true },
                            { field: "Name", title: "Title", filterable: true },
                            { field: "RequestorName", title: "Requestor", filterable: true },
                            { field: "Category", title: "Category", filterable: true },
                            { field: "Status", filterable: true },
                            { field: "Priority", filterable: true },
                            { field: "CreatedOn", format: "{0:MM/dd/yyyy}", filterable: false }
                ],
                dataSource: new kendo.data.DataSource({
                    transport: {
                        read: {
                            url: "/Ticketing/WebServices/TicketingService.asmx/GetTicketByProjectId",
                            contentType: 'application/json; charset=utf-8',
                            type: "POST",
                            dataType: "json",
                            data: { filter: null, sort: null },
                        },
                        parameterMap: function (data) {
                            return JSON.stringify(data);
                        }
                    },
                    
                    schema: {
                        data: "d",
                        total: "total",
                        model: {
                            id: "TicketID",
                            fields: {
                                Name: { type: "string" },
                                RequestorName: { type: "string" },
                                Category: { type: "string" },
                                Status: { type: "string" },
                                Priority: { type: "string" },
                                CreatedOn: { type: "date" }
                            }
                        }
                    },
                    pageSize: 20,
                    serverPaging: true,
                    serverSorting: true,
                    serverFiltering: true
                }),
                pageable: {
                    refresh: true,
                    pageSizes: [10, 20, 50, 100],
                    buttonCount: 12,
                },
                filterable: true,
                groupable: true,
                sortable: true,
                //selectable: true,
                filterable: true,
                reorderable: true,
                resizable: true,
                columnMenu: true
            });
        });
    </script>
--------------------------------------------------------------------------------WEB Service Method-------------------------------------------------------------------------------------
        protected Dictionary<string, DataTable> FilterColumns;

        [WebMethod]
        public IEnumerable<TicketListJSON> GetTicketByProjectId(int page, int pageSize, List<GridSort> sort = null, GridFilters filter = null)
        {
            int variable = 0;
            string orderBy = null;
            string filterString = null;
            if (sort != null && sort.Count > 0)
            {
                orderBy = "order by " + sort[0].field + " " + sort[0].dir;
            }
            if (filter != null && filter.filters != null && filter.filters.Count > 0)
            {
                filterString = GetFormatedFilterString(filter);
            }

            List<TicketDetails> TicketList = _fuzeTicketingController.GetTickets();
            List<TicketListJSON> TicletListJSONs = new List<TicketListJSON>();

            foreach (TicketDetails td in TicketList)
            {
                TicketListJSON TicketJSON = new TicketListJSON();
                TicketJSON.TicketID = td.TicketID;
                TicketJSON.Name = td.Name;
                TicketJSON.RequestorName = td.RequestorName;
                TicketJSON.Category = td.Category;
                TicketJSON.Type = td.Type;
                TicketJSON.Priority = td.Priority;
                TicketJSON.Status = td.Status;
                TicketJSON.CreatedOn = td.CreatedDate;
                TicletListJSONs.Add(TicketJSON);

            }
            
            return TicletListJSONs;
        }
------------------------------------------------------------------------  Response from web service ---------------------------------------------------------------------------------------
{"d":[{"__type":"NetApp.Web.UI.Fuze.WebServices.TicketingService+TicketListJSON","TicketID":14264,"Name":"Log a ticket to test validation","RequestorName":"administrator, administrator","Category":"Dashboard","Type":"Improvement","Priority":"3 - High","Status":"Needs More Info","CreatedOn":"\/Date(1402511400000)\/"},{"__type":"NetApp.Web.UI.Fuze.WebServices.TicketingService+TicketListJSON","TicketID":14263,"Name":"Editor Testing 2 Saveing text","RequestorName":"administrator, administrator","Category":"IBPOs Cat","Type":"Improvement","Priority":"3 - High","Status":"Pending Approval","CreatedOn":"\/Date(1401733800000)\/"},{"__type":"NetApp.Web.UI.Fuze.WebServices.TicketingService+TicketListJSON","TicketID":14255,"Name":"IE 8 issue","RequestorName":"administrator, administrator","Category":"Working 1","Type":"Task","Priority":"4 - Normal","Status":"New | New Sub 2 | New 3","CreatedOn":"\/Date(1399055400000)\/"}]}

----------------------------------------------------------------------------------------- Post to Web Service ------------------------------------------------------------------------------------------------------------
source  : {"filter":null,"sort":null,"take":10,"skip":0,"page":1,"pageSize":10}



























































Nikolay Rusev
Telerik team
 answered on 17 Jul 2014
1 answer
743 views

Hi,

I use kendo grid with number type column.
when adding new record, the numeric field gets automatically value 0.
I want to set  this field as empty by default and not as 0.
Is there any way to do it?

Thanks,
Alexander Popov
Telerik team
 answered on 17 Jul 2014
1 answer
108 views
Has there been any work done to resolve this issue:

http://www.telerik.com/forums/get-returns-undefined-when-using-serverpaging

To me, its unacceptable to say that these features are just "incompatible". Part of the reason we chose this product was to easily incorporate editable grids with virtual scrolling. Nowhere in the documentation did it mention that this could not be done.

Any updates/assistance would be greatly appreciated.

Thanks
Dimo
Telerik team
 answered on 17 Jul 2014
2 answers
799 views
Hello,

I'm new to Kendo ui grid and Juery.

Working on the Kendo ui grid with an Asp Page for a report (no MVC).

Managed to read the data(using json) but update seems  to be problem.

I can't figure a way to find the data send to server side. 

Technically, my web method in the aspx page is not triggered,transport update is not triggered as well.
Also. some tell me how to debug the kendo it'll be great. Stuck in this for the last two days

Jquery
 var dataSource = new kendo.data.DataSource({
              //autoSync: true,
              transport: {
//Working
                     read: {
                          url: "/Ajax/testAjax.aspx/GetInactiveBrokerData",           
                          type: "POST",
                          dataType: "json",
                          contentType: "application/json; charset=utf-8"
                             },
//Not working
                     update:               
                         {
                             url: "/Ajax/testAjax.aspx/updateBrokersInactiveData",
                             type: "POST",
                             dataType: "json",
                             contentType: "application/json; charset=utf-8"
                             //contentType: "application/x-www-form-urlencoded; charset=UTF-8"
                         },
                     parameterMap:
                            function (options, operation) {
//Working
                                if (operation == "read") {
                                    console.log('Transport READ Event Raised');
                                    //return { models: JSON.stringify(options.models) };
                                }
                                if (operation == "update" ) {
//Not Working
                                    console.log('Transport UPDATE Event Raised');
                                    //return { models: JSON.stringify(options.models) };
                                    }
                                },
                     batch: true,
                     schema: {
                         model: {
                             id: "intLogID",
                             fields: {
                                 intLogID: { type: "number", editable: false, nullable: false },
                                 dtConDate: { type: "date" },
                                 strBranchID: { type: "string", editable: false },
                                 strQuickComments: { type: "string" },
                                 strBranchName: { type: "string", editable: false }
                                        }
                                 }
                             }
                },
                   pageSize: 25
                                         });
              $("#grid").kendoGrid({
                  columns: [

                                                {
                                                    field: "dtConDate",
                                                    title: "Last Contact Date",
                                                    width: 150
                                                }, {
                                                    field: "strBranchID",
                                                    title: "Branch ID",
                                                    width: 100
                                                }, {
                                                    field: "strBranchName",
                                                    title: "Branch Name",
                                                    width: 200
                                                }, {
                                                    field: "strQuickComments",
                                                    title: "Quick Comments",
                                                    width: 250
                                                }],
                  dataSource: dataSource,
                  pageable: {
                      refresh: true,
                      messages: {
                          refresh: "Refresh the grid"
                      },
                      pageSizes: [5, 10, 50, 100],
                      buttonCount: 3
                            },
                  
                  height: 550,
                  groupable: true,
                  navigatable: true,
                  sortable: true,
                  pageSize: 25,
                  resizable: true,
                  filterable:true,
                  toolbar: ["save", "cancel"],  
                  editable: true,
                  saveChanges: function (e) {
                      if (!confirm("Are you sure you want to save all changes?")) {                   
                          e.preventDefault();                      
                      }
                  }
              });

Aspx
 <System.Web.Services.WebMethod()> _
    Public Shared Sub GetInactiveBrokerData()
        HttpContext.Current.Response.Write(getJsonData)
        HttpContext.Current.Response.Flush()
        HttpContext.Current.ApplicationInstance.CompleteRequest()
        HttpContext.Current.Response.SuppressContent = True
    End Sub
    
    <System.Web.Services.WebMethod()> _
    Public Shared Sub updateBrokersInactiveData(ByVal lstTracker As List(Of Tracker))
        'Dim json As String = Request("models")
        Dim strUpdOutput As String = ""
        conMyData = New SqlConnection(ConfigurationManager.AppSettings("tracker"))
        cmdSelect = New SqlCommand("[sunworldplus].[tracker_new_inactive_brokers_update_comments]", conMyData)
        conMyData.Open()
        cmdSelect.CommandType = CommandType.StoredProcedure
        sqldr = cmdSelect.ExecuteReader
        
        While sqldr.Read()

        End While
        
        If IsNothing(sqldr) Then
            sqldr.Close()
            conMyData.Close()
        End If
        ''Return strUpdOutput
    End Sub

It'll be great if someone point me in the right direction.
Binny
Top achievements
Rank 1
 answered on 16 Jul 2014
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
Drag and Drop
Application
Map
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
DropDownTree
ListBox
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
Licensing
PivotGridV2
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
LLM Kit
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?