This is a migrated thread and some comments may be shown as answers.

Create & Modify Existing row In Popup Editor

11 Answers 155 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chatra
Top achievements
Rank 1
Chatra asked on 21 Apr 2014, 07:18 PM
Hi,

I have demo here with popup editor .Not sure on how to add a new/Create record or modify a existing record in the grid.

Note included Kedno/Js files

Thanks,
Chatrapathi Chennam

11 Answers, 1 is accepted

Sort by
0
Chatra
Top achievements
Rank 1
answered on 22 Apr 2014, 07:31 PM
Hi have a demo here, Where I am just reading fake data(from Api Controller). Instead of that I want to Insert Data into First Grid (Writer) by adding or creating it and read it back using Api Controller. Can any one help me in it with Pseudo Code.                         

create: {
                         url: crudServiceBaseUrl + "/AddUnderwriterData",                                                                    
            },
I have above thing which is going now where(event) ;when Save button  is clicked in popup editor.


Thanks
Chatrapathi Chennam
0
Daniel
Telerik team
answered on 23 Apr 2014, 12:40 PM
Hi,

Please check the " grid-webapi-crud"  sample project from this GitHub repository. It demonstrates how to perform CRUD operations with the grid when using the Web API.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Chatra
Top achievements
Rank 1
answered on 23 Apr 2014, 02:14 PM
Hi Daniel,

Thanks for the reply.

The example gave me much info but couldn't solve my problem of where create/update going wrong.

Please find the updated demo version ,where i am able to read the static data into grid but not able to save/update.Here I am using Ndatabase(dll) for saving/reading  the data from.

Please can you look at it.

Thanks in Advance

Chatrapathi Chennam





0
Accepted
Daniel
Telerik team
answered on 25 Apr 2014, 01:08 PM
Hello again,

From the code it is not clear how should the new "Writer" id be generated. I am attaching the project with the needed modifications added in order for the create and update operations to work using a static id for the new "Writer".

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Chatra
Top achievements
Rank 1
answered on 29 Apr 2014, 08:39 PM
Hi Daniel,

The solution really helped and thanks for the reply.

I do have some more questions related to demo.

1) we do set the writer datasource(uwdataSource) which has agents data also and it doen't make page light weight when their is more records in agents for each writer.  And also on Edit we set the agents model to agents grid as datasource.   Is their better way of doing it(Configure) to get agents data on to the page only on Edit of existing writer record in the writer grid.

2) By default popup Editor window Title is set to EDIT .Can we change the Tiltle of popup Window based  on Action on the grid like Edit for editing the existing record in the grid and for Adding a new record  set the Title to Create or Add.


Thanks
Chatrapathi Chennam
0
Accepted
Daniel
Telerik team
answered on 01 May 2014, 07:04 PM
Hello,

You could configure the popup grid dataSource for remote binding and exclude the agents from the writers in order for the agents to be loaded only when entering edit mode.
As for the window title - it can be changed in the grid edit event if the item that is being edited is a new one e.g
function edit(e) {
    if (e.model.isNew()) {
        e.container.data("kendoWindow").title("Create");
    }
}


Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Chatra
Top achievements
Rank 1
answered on 05 May 2014, 09:49 PM
Hi Daniel ,

Thanks for the reply.

I have come across another issue when setting up the height and width of pop editor for Agents Grid(Add/Edit) action in Tab strip .

When trying to set height and Width of popup editor with $(".k-edit-form-container") ;The parent popup is also getting changed.( I am setting  at Line :377 ;writer.js  of Agent grid in the Demo).Is the any other way to set the height and width of second  Popup editor without changing the (Height and  Width) of First popup editor.
  
Thanks,
Chatrapathi Chennam








0
Daniel
Telerik team
answered on 07 May 2014, 12:27 PM
Hi,

You can search for the element in the context of the editable container in order to avoid setting the style to both elements e.g.
edit: function (e) {
    $(".k-edit-form-container", e.container).width(700).height(200);


Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Chatra
Top achievements
Rank 1
answered on 08 May 2014, 02:12 PM
Hi Daniel,

Thanks for Quick reply.

In process , have come across a issue with filter search on column not sure it is default functionality of kendo.

1) If we set a datasource on the column  as below and try to type in Filter search box the conditions are changing to default to "Starts with" even though if we set to some other conditions like (is equal to, Contains....) and start to type the search word.

steps to reproduce: 
a) set the datasource for Auto complete as below
b) select condition other than "Starts with"
c) start to type a word in search box related to items in column .
d) condition is automatically change to "Startswith"

  { field: "Name", title: "Name", filterable: {
                                            ui: function (element) {
                                                element.kendoAutoComplete({
                                                    dataSource: uwdataSource,
                                                    dataTextField: "Name"
                                                })
                                            }
                                        }},
                            { field: "Code", title: "Code", filterable: {
                                ui: function (element) {
                                    element.kendoAutoComplete({
                                        dataSource: uwdataSource,
                                        dataTextField: "Code"
                                    })
                                }
                            }
                            },

2) I am looking for some examples where we can Create/Edit a row Item in a grid other than through process of "popup edit or Inline edit"  but through a form outside of the grid.Like when we click a Add new record on tool bar of grid a form opens in same page  beside the  grid and we can enter data into form and save it ;and which pushes the form data to grid . Please point me if some examples exist of its kind.

Thanks,
Chatrapathi Chennam







0
Chatra
Top achievements
Rank 1
answered on 08 May 2014, 05:20 PM
Forgot to mention in previous post.

3) The server filtering doesn't work on Code field even when I set the  server sorting  is true and sort: { field: "code", dir: "asc" },

Thanks, 
Chatrapathi Chennam
0
Accepted
Daniel
Telerik team
answered on 12 May 2014, 08:18 AM
Hi again,

I am not sure if understand the third question. Please clarify what you mean by:
 The server filtering doesn't work on Code field even when I set the  server sorting  is true and sort
At least in the sample project neither server filtering nor server sorting was implemented in the controller. Also, in the code that you provided the sort field is incorrect. It should be "Code" instead of "code".

The filter operator is changed because the same dataSource is used for the autocomplete and the grid. The autocomplete filters the items when typing by applying a filter to its dataSource and so the operator will be changed to the one used for the autocomplete(starts with by default). You should pass just the data to the autocomplete:
{
  field: "Name",
    title: "Name",
      filterable: {
        ui: function (element) {
          element.kendoAutoComplete({
            dataSource: uwdataSource.data().toJSON(),
            dataTextField: "Name"
          })
        }
      }
}
or use a separate dataSource if the filter operator should not be applied to the grid.

Regarding the editor - please check this code-library which demonstrates using an external editor.


Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Chatra
Top achievements
Rank 1
Answers by
Chatra
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or