Telerik Forums
Kendo UI for jQuery Forum
1 answer
937 views
How to refresh a window from within? I have button in the window content that should refresh the window .
Alex Gyoshev
Telerik team
 answered on 07 Aug 2012
0 answers
74 views
Hi all,
The title describes my problem. ASP.NET AJAX provides the feature but not sure if its supported in MVC or does anyone have a workaround to this?
Regards,
Bernard
Bernard
Top achievements
Rank 1
 asked on 07 Aug 2012
1 answer
316 views
Hello  All ,

Im new    to Kendoui  web   and  i have been  getting my hands  dirty  with it .  but    i need  help  with  this  issue. im  using kendo with java or jsp  and  i could   read  records  from  an oracle database  unto the   grid.  and  i could  do an insert or  create operation to the  same oracle  database. but  i could not  do an update or delete operation  on the grid.  i keep  getting  an error . i  need  somebody to  tell  me what im doing  wrongly.  here is a sample of my code :   


  <Script>  
      
         
                      
    $("#grid").kendoGrid({
        
    dataSource: {
        transport: {
            read: "listdepart.jsp",
            create: {
                url: "insertdepart.jsp",
                type: "POST"
            } 
           
        },
        update:{
            url: "updatedepart.jsp",
            type:"POST"
        },
        destroy:{
            url:"deleletdepart.jsp",   
            type:"POST"
        },
        
          parameterMap: function (options, operation) {
                        if (operation !== "read" && options.models) {
                            return { models: kendo.stringify(options.models) };
                        }
                    
                },
            batch: true,
            pageSize:5 , 


        schema: {
            data: function(result) {     
              return result.data || result;
            },
            total: function(result) { 
                var data = this.data(result);
                return data ? data.length : 0;
            
        },
            
            model: {
                id: "deptid",
                fields: {
                   // id: { editable: false },
                   id: { validation: { required: true} ,type: "number" } ,
                   name: { validation: { required: true} }
                }
            }
            
        }
      
    },
    
  
    
    //detailTemplate: kendo.template($("#template").html()),
   //// detailInit: detailInit,
    editable: true,
    navigable: true,  // enables keyboard navigation in the grid
    pageable:true,
    serverPaging: true,
    groupable: true,
    sortable:true ,
    filterable:true,
   // toolbar: [ "save", "cancel" ,"create" ],  // adds save and cancel buttons,
    toolbar: [ { name :"create" , text: "Add New Department" }],  // adds save and cancel buttons,
    editable:"popup" ,
    columns: [{title: "Department ID", field: "deptid" }, { title: "Department Name",field: "name" } ,{ title: "Action", command: ["edit", "destroy"] }]
   
   
    
});
          
 </script>

here  are  my  jsp 

for insert
===========
<%
 
 response.setContentType("application/json"); 
try  {
String dept_id = request.getParameter("deptid");
String dept_name = request.getParameter("name");




String jdbcname = "jdbc/orcl";
    
    
    Context ctx = new InitialContext();
    Context envCtx = (Context)ctx.lookup("java:/comp/env");
    DataSource ds = (DataSource)envCtx.lookup(jdbcname);
    Connection conn = ds.getConnection();
    Statement stmt = conn.createStatement();
     ResultSet rs  = null ;




// if (bsave.equals("savechanges")) {
String cmd2 = "insert into   department  (deptid , name)  values ('"+dept_id+"' , '"+dept_name+"')";
  rs = stmt.executeQuery(cmd2);
            if (rs.next()) {
        StringBuffer data = new StringBuffer("{\"data\":["); 
               data.append("{\"Insert was done sucessfully"  + "\"},");
             data.setCharAt( data.length()-1,']');  // replace last character with ]
             data.append("}");
          out.println(data.toString());
            } else {
              StringBuffer data = new StringBuffer("{\"data\":["); 
               data.append("{\"Insert was not done sucessfully"  + "\"},");
             data.setCharAt( data.length()-1,']');  // replace last character with ]
             data.append("}");
          out.println(data.toString());
conn.close();
            }
     //}





 } catch(Exception e) {
    out.println("Error: " + e);
    e.printStackTrace();
  }
%> 

===============================================================================
for delete or update ( Almost  the   same just operations  )
==============================================================


 response.setContentType("application/json"); 
try  {
String dept_id = request.getParameter("deptid");
String dept_name = request.getParameter("name");




String jdbcname = "jdbc/orcl";
    
    
    Context ctx = new InitialContext();
    Context envCtx = (Context)ctx.lookup("java:/comp/env");
    DataSource ds = (DataSource)envCtx.lookup(jdbcname);
    Connection conn = ds.getConnection();
    Statement stmt = conn.createStatement();
     ResultSet rs  = null ;






String cmd2 = "delete  from   department  where  deptid = '"+dept_id+"'";
  rs = stmt.executeQuery(cmd2);
            if (rs.next()) {
        StringBuffer data = new StringBuffer("{\"data\":["); 
               data.append("{\"Delete Operation  was sucessfully"  + "\"},");
             data.setCharAt( data.length()-1,']');  // replace last character with ]
             data.append("}");
          out.print(data.toString());
            } else {
              StringBuffer data = new StringBuffer("{\"data\":["); 
               data.append("{\"Delete Operation  was not  sucessfully"  + "\"},");
             data.setCharAt( data.length()-1,']');  // replace last character with ]
             data.append("}");
          out.print(data.toString());
conn.close();
            }
 } catch(Exception e) {
    out.println("Error: " + e);
    e.printStackTrace();
  }
%> 
        
Any  help  to get this working   will  really  be appreciated.




Adebayo
Top achievements
Rank 1
 answered on 07 Aug 2012
1 answer
291 views
Hi,
I have used Kendo UI for doing my application in ASP.NET. Here I am calling a page as a view from a parent page. Both have separate master pages.. I can't create Date picker in child page which has the error while creating.

I am listing the source of the page here.

<%@ Page Title="" Language="C#" MasterPageFile="~/m/Blank.Master" AutoEventWireup="true"
    CodeBehind="FileDetails.aspx.cs" Inherits="LegalPaperwork.m.FileDetails" ValidateRequest="false" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../js/kendo/kendo.all.min.js" type="text/javascript"></script>
    <link href="../Styles/kendo/kendo.default.min.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/kendo/kendo.common.min.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .inputs
        {
            font-size: 15px !important;
            font-weight: normal;
        }
        .labels
        {
            font-size: 12px !important;
            font-weight: bold;
        }
        
        .heading
        {
            font-size: 12px !important;
            font-weight: normal;
        }
        
        .button
        {
            width: 150px !important;
            text-align: center;
        }
    </style>
  
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="example" class="k-content">
        <div data-role="view" id="issues" data-transition="slide">
            <div data-role="navbar" class="heading">
                Issues <a href="#appwrapper" data-role="backbutton" data-align="right">Cancel </a>
            </div>
            <div>
                <table align="center">
                    <tr>
                        <td width="50">
                            <asp:Label ID="Label15" runat="server" CssClass="labels" Text="File "></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="lblDocumentName0" runat="server" CssClass="labels"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Label ID="Label16" runat="server" CssClass="labels" Text="Case "></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="lblCase3" runat="server" CssClass="labels"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:Label ID="Label17" runat="server" CssClass="labels" Text="Submitted to Court By "></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:DropDownList ID="dropSubmittedBy" runat="server" Width="255px" DataTextField="Name"
                                DataValueField="RowKey" CssClass="inputs">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:Label ID="Label18" runat="server" CssClass="labels" Text="Submitted to Court On"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <input id="datepicker" value="November 2011" style="width: 150px" />
                               
                        </td>
                    </tr>
                    <tr>
                        <td align="center" colspan="2">
                            <asp:Button ID="btnUpdateSubmission" runat="server" Text="Update" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
          <script type="text/javascript">
       
$(document).ready(function(){
 $("#datePicker").kendoDatePicker();
});
        
        </script>
    
</asp:Content>


----------------------------------------------------------
This is the error I am getting..
Microsoft JScript runtime error: Object doesn't support property or method 'kendoDatePicker'

 Why it is happen..?Please help me..
comgiu
Top achievements
Rank 2
 answered on 07 Aug 2012
0 answers
77 views
hi,

It is possible to use kendoAutoComplete in mobile application.

it is work or not

Thanks,
Raghwenda
Nick
Top achievements
Rank 1
 asked on 07 Aug 2012
0 answers
173 views
Hello,

I have an Editor Template in which only a DropDownList is present. I am trying to populate that DropDownList using an action on my controller. I have the following code:

@(Html.Kendo().DropDownListFor(m => m)
                .DataSource(
                    datasource => datasource
                        .Read(r => r.Action("GetPossibleLines", "ProductionProgram"))
                        .ServerFiltering(true)
                    )
                .DataTextField("Text")
                .DataValueField("Value")
                .HtmlAttributes(new { style = "width: 200px" }))

My action looks like this:

[HttpPost]
public ActionResult GetPossibleLines()
{
    var options =
        new List<SelectListItem>()
        {
            new SelectListItem() { Text = "LI50", Value = "51" }
        };
 
    return Json(options);
}

What am I doing wrong? The DropDownList doesn't get filled and keeps loading forever.
Max
Top achievements
Rank 1
 asked on 07 Aug 2012
0 answers
183 views
I have temporarily worked around this issue by flattening our data.  Now I am trying to let users edit a single field, however Kendo seems to be acting a little funny.

First, the system submits ALL fields in the model, whether they have changed or not.  This is bad on a number of accounts for us (auditing, repudiation, performance, etc.).  How do I tell Kendo to only submit the deltas?

Second, the additional fields it is submitting are being submitted as null.  Is this by design?  On the server, here is what we get for two values.  The first is a string I had provided as "null" and the other was just a NULL value that Kendo submitted.

Request.Form["String1"] == ""null""  (note the extra quotes, this is the string value of "null" quotes in included)
Request.Form["OtherValue"] == "null"  (note only in one set of quotes, because this is the string "null", with no quotes)

What is the best practice for submitting NULL values in Kendo?  Am I supposed to special case this on the server by pre-processing the Request.Form object?


Thanks!
rudy
Top achievements
Rank 1
 asked on 07 Aug 2012
1 answer
127 views
Hi,

Is there a way to have the kendoGrid editing popup window display only over the grid itself, that is, not cover the entire body of the document, but only cover the DIV element that has become the kendoGrid?

Thanks,

Dan
Daniel
Top achievements
Rank 1
 answered on 07 Aug 2012
0 answers
179 views
Can anyone point me to examples of the two overloads for the template column in a .cshtml file?
Tim
Top achievements
Rank 1
 asked on 06 Aug 2012
0 answers
171 views
We have a Kendo grid binding to a custom JSON model.  It looks something like this:

{
    id:  "{GUID}",
    name: "user",
    attributes:
    {
        firstname: "Joe",
        lastname: "Meadows"
     }
}

We are able to get this to bind to the grid using custom templates.  In addition, we are able to allow inline editing to work by configuring
the columnInfo "field" value to be "attributes.fieldname".

However, when we go to save the inline edits, the grid is again confused and is trying to write to the root object.  Example:

{
     id: "{GUID}"
     firstName: "Tony",

    ...
}

How can I get it to properly save my values into my .Attributes collection?

Thank you!
rudy
Top achievements
Rank 1
 asked on 06 Aug 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
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
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
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?