Telerik Forums
Kendo UI for jQuery Forum
1 answer
169 views
For the life of me, I can not figure out why this is happening.

Below I have a pretty simple grid wired to a Read and a Destroy event.  The Read works.  If I press delete and then save the grid the wrong webservice is called.

If batch editing it turned on then when I press save the READ event is called (instead of the Destroy event). And I get the error that I can't stuff an enumeriable list of objects into the ID field of the Read service.

If batch editing is turned off then the CREATE event is called! And since I haven't created one I get a 404.

That's weird man.  Any ideas?

$("#JobAttachments").kendoGrid({
    columns: [
                { title: "Filename", template: "<a href='../UploadedFiles/${ SavedFileName }'>${ OriginalFileName }</a>", width: "250px" },
                { field: "EnterBy", title: "Uploaded By", width: "200px"},
                { command: "destroy", title: "Delete", width: "100px" }
            ],
    toolbar: ["save", "cancel"], // specify toolbar commands
    editable: true, // enable editing
    dataSource: {
        schema: {
            data: "d", // ASMX services return JSON in the following format { "d": <result> }. Specify how to get the result.
            model: { // define the model of the data source. Required for validation and property types.
                id: "JobTaskId",
                fields: {
                    AttachmentID: { editable: false, nullable: false },
                    JobId: { editable: false, nullable: false },
                    OriginalFileName: { editable: false },
                    SavedFileName: { editable: false },
                    AttachmentType: {  },
                    Notes: { },
                    EnterBy: {}
                    //,
                    //EnterDate: { type: "date"}
                }
            }
        },
        batch: false, // enable batch editing - changes will be saved when the user clicks the "Save changes" button
        transport: {
            create: {
                url: "../WebServices/JobAttachmentWebservice.asmx/NotUsed",
                contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                type: "POST" //use HTTP POST request as the default GET is not allowed for ASMX
            },
            read: {
                url: "../WebServices/JobAttachmentWebservice.asmx/Read",
                contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                type: "POST" //use HTTP POST request as the default GET is not allowed for ASMX
            },
            update: {
                url: "../WebServices/JobAttachmentWebservice.asmx/Update",
                contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                type: "POST" //use HTTP POST request as the default GET is not allowed for ASMX
            },
            destroy: {
                url: "../WebServices/JobAttachmentWebservice.asmx/Delete",
                contentType: "application/json; charset=utf-8", // tells the web service to serialize JSON
                type: "POST" //use HTTP POST request as the default GET is not allowed for ASMX
            },
            parameterMap: function (data, operation) {
                if (operation != "read") {
                    // web service method parameters need to be send as JSON. The Create, Update and Destroy methods have a "products" parameter.
                    return JSON.stringify({ jobView: data.models })
                }
                else {
                    return JSON.stringify({ JobId: currentJobId })
                }
            }
        }
    }
});
Laura
Top achievements
Rank 1
 answered on 18 Jul 2012
3 answers
524 views
I only want users to be able to leave my autocomplete field empty, or select an item from the list - I don't want them able to enter their own "new" item. How can I force a valid selection (either by clearing the invalid data, or not allowing the focus to leave the control, or some other variation)?
Dimo
Telerik team
 answered on 18 Jul 2012
1 answer
7.1K+ views
Ok, I'm missing something somewhere.

I need to be able to set focus to a specific cell (cellIndex) when a grid is in inline edit mode.

Is it possible to do this?

Jerry
Iliana Dyankova
Telerik team
 answered on 18 Jul 2012
2 answers
108 views
Using MVVM, how can I set the column widths for a bound grid (using templates)?
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 18 Jul 2012
1 answer
183 views
Hi,

Initially i am having 4 tabs.Now i am have a button addTab when ever i am clicking a addTab it is adding a newTab with some content.
I have declared only one <div> tag and i am adding the tabs dynamically.it works fine.But, when ever i am clicking the newly added tab and going back to the already defined tabs it is displaying two contents.How can i rectify that problem.Is any thing wrong with the div tags.Please provide me any samples.



Thanks
Harut
Top achievements
Rank 1
 answered on 18 Jul 2012
3 answers
405 views
how get the upload progress (0-100) using the API? or another way
T. Tsonev
Telerik team
 answered on 18 Jul 2012
4 answers
871 views
Hello Good People,

i've been fan of telerix product for so long but honestly this kendo ui has blown my mind. Kudos to the team behind it.I choose kendo over wijmo and pure jquery ui especially because of component as the grid.BUT my first attempt to the grid has turn out be a challenge for me.so many hours trying to figure out why my code is not working. am using,php 5.3.5, kohana 3.2 with mysql jquery 1.7.2., firefox 9.0.1, chrome 20.0.1132.57 m .So am pulling data from mysql . with firebug activated i could not find any reason why my codo should not work. i even copy the code from one of the example file just to be sure am not the cause of it. the data is returned as one would expect , a valid json format string as shown on the attached file. i use northwind database for my trial.

Can anyone give a hand? there is something am not doing right ?

here is a snippet of the clientside file. 

<div style="height: 35px"></div>
<div id="clientsDb"> 
    <div id="grid"></div>
</div> 
<script type="text/javascript">
    $(function(){
        $("#grid").kendoGrid({
            dataSource: {
                type: "odata",
                transport: {
                    read: {url: "read", datatype: "json", contentType: 'application/json'}
                },
                schema: {
                    model: {
                        fields: { 
                              CompanyName: {type: "string"},
                              ContactName: {type: "string"}                       
                        }
                    }
                },
                pageSize: 10,
                serverPaging: true,
                serverFiltering: true,
                serverSorting: true
            },
            height: 250,
            filterable: true,
            sortable: true,
            pageable: true,
            columns: [
 
                  {field: "CompanyName", title: "Company Name"},
                  {field: "ContactName", title: "Contact Name"}
            ]
 
        });
    });
</script>

here is my php/kohana/mvc action 
public function action_read()
{
 
        $query = DB::select("ContactName","CompanyName")->from("customers")->offset(0)->limit(10);
        $accounts = $query->execute("northwind");
        $toSend = array();
        foreach($accounts as $acc){
            $toSend[] = $acc;
        }
//        $data = "{\"results\":". json_encode($toSend)."}";
        $data =  json_encode($toSend);
        $this->auto_render = false;
        echo $data;
    }
joseph
Top achievements
Rank 1
 answered on 18 Jul 2012
3 answers
385 views
Is it possible to open kendo window within a container(workspace,div ...). I need to open multiple windows within a workspace (say a ..div ). The windows should be movable only inside the container and not beyond that. Is there a way of achieving this.
Dimo
Telerik team
 answered on 18 Jul 2012
0 answers
109 views
Hi There

I am extremely extremely new to kendo and i am really having a problem with the kendo buttons for a web page.

I have the bottons where I need them etc but I need the buttons to call functions in another class.

Where do I do that? Usually I'd just double click on the button and it would show me the coding place but these buttons do not.

How do I do it?

Please please help I am desperate.

Thank you.
Syanne
Top achievements
Rank 1
 asked on 18 Jul 2012
0 answers
204 views
Hello, I trying to implement a delete and edit links in a custom column in Kendo grid (razor engine ), 
I have images for the buttons and I want to use them so that I can trigger the appropriate actions in my controller.
The two buttons (as I implemented them in regular HTML) are as follows 
<td class="edit_td">
                        <a href="@Url.Action("DataSourceEdit", "Configuration", new { dataSourceID = item.DataSourceID })" title="edit" class="button_edit_icon">
                        </a>
                        @Ajax.ActionLink(" ", "DataSourceDelete", "Configuration", new { dataSourceId = item.DataSourceID, version = item.VersionOfTypeString },
                        new AjaxOptions
                        {
                            HttpMethod = "POST",
                            Confirm = "Are you sure you want to delete " + item.Name.ToString() +" Data Source?",
                            OnSuccess = "deleteConfirmation"
                        }
                            , new { @class = "button_delete_icon" }
                            )
                    </td>

As you can see the Edit is simple URL (with class it will attach correct image) 

but the delete is an Ajax call to the action with parameters, on success it will cal JS function and remove a marked  row from my HTML table. Here is my question how can I implement this in Kendo UI Grid for mvc (Razor Engine )

Thank you in advance
Vitali
Top achievements
Rank 1
 asked on 18 Jul 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?