This is a migrated thread and some comments may be shown as answers.
Saving
3 Answers 128 Views
This is a migrated thread and some comments may be shown as answers.
Kevin Donahue
Top achievements
Rank 1
Kevin Donahue asked on 22 Jul 2011, 07:36 AM
Is there a way to automatically save the file when the save command is clicked without showing the dialog?  Possibly the best thing would be for me to override the behaviour of some of the commands.  Is this possible?

On a side note:  I get a javascript error when I start typing in the crop width or height dialog.  I was trying to type 100. I selected the current value in the height textbox, type the 1, and it gets the error.

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 22 Jul 2011, 10:52 AM
Hello Kevin,

Yes, it is possible to add custom toolbars and custom buttons to the toolbar. Here is an example which demonstrates how to implement a custom Save button:

Copy Code
<telerik:RadImageEditor ID="RadImageEditor1"runat="server"ImageUrl="~/ImageEditor/images/hay.jpg"
Width="720px"Height="430px">
  <tools>
    <telerik:ImageEditorToolGroup>
       <telerik:ImageEditorTool CommandName="SaveImage"ImageUrl="Save.png"/>
       <telerik:ImageEditorTool CommandName="Rotate"/>
    </telerik:ImageEditorToolGroup>
  </tools>
</telerik:RadImageEditor>
<script type="text/javascript">
Telerik.Web.UI.ImageEditor.CommandList["SaveImage"] = function(imageEditor, commandName, args) {
    imageEditor.saveImageOnServer("",true); //saves the image on the server - it either overwrites the file or keeps both files
};
</script>
</telerik:RadAjaxPanel>

As to the JS error: Are you able to reproduce this problem under the Default Example of RadImageEditor and under which browser? I tried to reproduce the problem but without success. You can see my test at: http://screencast.com/t/9wnKarqI

Could you please send us also the whole error message?

Regards,
Rumen
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Kevin Donahue
Top achievements
Rank 1
answered on 25 Jul 2011, 12:21 AM
Hi Rumen,

I saw in your test that you clicked the crop button, but the dialog actually turned into a resize image dialog.  Another issue?

Anyway, I'm running on IE 8. When I type 1 in the crop window width text box, the error happens here:

},setContentSize:function(d,c){if(!d){throw Error.argumentNull("element");
}if(!c){throw Error.argumentNull("size");
}if($telerik.getCurrentStyle(d,"MozBoxSizing")=="border-box"||$telerik.getCurrentStyle(d,"BoxSizing")=="border-box"){var b=$telerik.getBorderBox(d);
var a=$telerik.getPaddingBox(d);
c={width:c.width+b.horizontal+a.horizontal,height:c.height+b.vertical+a.vertical};
}d.style.width=c.width.toString()+"px";
d.style.height=c.height.toString()+"px";
}

Thanks for the help on the save and customization.  I'll give it a try.
0
Niko
Telerik team
answered on 26 Jul 2011, 09:23 AM
Hi Kevin,

Indeed I was able to reproduce the issue that you have reported. We will look into it and have it fixed in due time. You can check the progress on the issue through our PITS - http://www.telerik.com/support/pits.aspx#/public/aspnet-ajax/7113.

As a sign of gratitude for your persistence in this matter, I have updated your Telerik points.

Greetings,
Niko
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Asked by
Kevin Donahue
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Kevin Donahue
Top achievements
Rank 1
Niko
Telerik team
Share this question
or