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

RadGrid, Timer, RadEditor

3 Answers 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sam Stange
Top achievements
Rank 1
Sam Stange asked on 06 May 2009, 02:24 PM
Hi,

I'm trying to develop an app where users can add, edit, delete comments. Users have requested an "auto-save" feature for the comments because they spend a lot of time on single pages. We considered using a rad window, but users wanted to see the contents of the page (no modal dialog). My current approach is to use a RAD Ajax, RAD Grid, Rad Editor, and a timer. Does anyone have an example of something similar?

Thanks,
Sam

3 Answers, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 06 May 2009, 05:18 PM
Hello Sam-

That general approach should work. I'd only suggest that you use web services and JavaScript to keep your auto save as lighweight as possible. In fact, I created a video some time ago showing you exactly to implement auto-save with RadEditor and a WCF web service:


Check it out and see if it helps.

-Todd
0
Sam Stange
Top achievements
Rank 1
answered on 06 May 2009, 08:35 PM
Thanks Todd. That approach seems promising! Coding it up now.

Sam
0
Sam Stange
Top achievements
Rank 1
answered on 07 May 2009, 12:00 AM
Todd,

After a few hours, I got it! Inside a RadGrid I've got a RadEditor that displays when a user attempts to update a comment that is set to save everytime a user doesn't type for 3 seconds. No Modal too! Using WCF worked very nicely!

Here are my big lessons... When you edit, make sure you have ClientDataKeyNames set as well as DataKeyNames. Nothing like getting null key values! That confused me for a good hour.

As well for updates, I used the OnCommand Client Side event:

<ClientSettings>
          <ClientEvents OnCommand="RaiseCommand" />
</ClientSettings>

function RaiseCommand(sender, args) {
                    if (args.get_commandName() == "Edit")
                    {
                        var itemIndex = args.get_commandArgument();
                        var grid = sender;
                        var MasterTable = grid.get_masterTableView();
                        var item = MasterTable.get_dataItems()[itemIndex];
                        reviewCommentID = item.getDataKeyValue("Review_Comment_ID");
                    }
                }

Thanks a million. I'm sure I'll find some other bugs with this implementation, so I'll try to update this spot so others can use this as well.

Sam
Tags
Grid
Asked by
Sam Stange
Top achievements
Rank 1
Answers by
Todd Anglin
Top achievements
Rank 2
Sam Stange
Top achievements
Rank 1
Share this question
or