PDA

View Full Version : Ext.Direct Using .net 3.5



shibubh
16 Apr 2009, 2:29 AM
this is the dotnet version of Ext.Direct example

last update: update on 20 may 2009

http://www.ny504427.bizhostnet.com/Direct.zip

shibubh
16 Apr 2009, 5:39 AM
Update on 10th may

Luc
16 Apr 2009, 11:11 PM
Hi sibubh,

I 'ld like to have a look at the code, but it seems that both the zip files are corrupted. Can you check?

Thanks for posting!

shibubh
17 Apr 2009, 12:05 AM
no its working. re-download the file

McG
17 Apr 2009, 12:11 AM
nice example - thank you :)

jay@moduscreate.com
17 Apr 2009, 4:24 AM
Holy crap dude, that was fast!! Awesome job.

arthurakay
17 Apr 2009, 8:40 AM
I haven't looked at the code yet, but I'm working in .NET and will probably need this when we upgrade to 3.0. I'm glad someone is jumping ahead on this!

Brendan Carroll
17 Apr 2009, 9:43 AM
Very nice

freygrob
17 Apr 2009, 2:38 PM
in your js code, replace all "out.el.scrollTo('t', 100000, true);" by :
out.el.dom.parentNode.scrollTop = out.el.dom.parentNode.scrollHeight;
and displayfield scrollbar will work.

shibubh
10 May 2009, 1:59 AM
Now Support for Auto Generate Api.
Updated to support to ext-3.0-rc1.1.

crp_spaeth
10 May 2009, 11:26 AM
Hey shibubh,

nice to see some updates!! Thank you for sharing this stuff.

I have just added few things to your projekt and would like to share a few thoughts...

I have added a small pice of logic into the router.ashx.cs to be able to handle the response of an Ext.Direct Actions with a File Upload correctly:


public void ProcessRequest(HttpContext context)
{
// set default contenttype to json
context.Response.ContentType = "application/json";
//
string responseWrapStart = "";
string responseWrapEnd = "";
// check if the request contains a Fileupload. If so the router needs to return an HTML Document containing a Textarea
if (context.Request.Files.Count > 0)
{
// The server response is parsed by the browser to create the document for the IFRAME.
// If the server is using JSON to send the return object, then the Content-Type header must
// be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.
context.Response.ContentType = "text/html";
responseWrapStart = "<html><textarea>";
responseWrapEnd = "</textarea></html>";
}


// execute the Action
var rpc = new ExtRPC();
string json = rpc.ExecuteRPC(context.Request);

// send eventually wraped content back to the browser
context.Response.Write(responseWrapStart);
context.Response.Write(json);
context.Response.Write(responseWrapEnd);
context.Response.End();

}

I than changed the whole ExtRPC Class to work with JSON.NET instead of your Json Parser, but i am not ready jet...
Since JSON.NET is Free to use and in my experience a very fast and powerful Tool, I would like to know what you think about integrating it to your Project?

Further I'am not into an Opensource Project jet but I really would like to start one or just help to get it started. What do you think about making this Projekt to an Opensource Project on googlecode or sourceforge ?

shibubh
10 May 2009, 8:30 PM
hi crp_spaeth
Yes we can do that. we can make this project open source. and nice code snipped for file upload.

shibubh
12 May 2009, 12:48 AM
Update On 12th may 2..9
Update
1. Direct Core
2. Configuration using web config.
3. Sample added (DirectTree, Image organizer )

download http://ny504427.bizhostnet.com/Direct/ExtDirect.zip

Just add the


<configSections>
<section name="direct" type="ExtDirect.Direct.Configuration.DirectSettings"/>

</configSections>
<direct url="../Router.ashx" cache="true" />

on web config file and change the proxy.ashx code


context.Response.ContentType = "text/JavaScript";
string api = "";
api = DirectProxyGenerator.getAPI(context);
context.Response.Write(api);

savanna
13 May 2009, 10:59 AM
Thanks shibubh for sharing this. I am new to ExtJs and have been trying out the Ext.Direct for the last couple of days. I simply cannot get the DirectStore working. I can see the request coming back from the server with correct data but the grid shows nothing.

Then I looked at your grid example. I noticed you have a section at the begining that overrides the default DirectProxy. Is there a bug in the ExtJs code? As soon as I put that override in to my test code, it started working like a charm.



Ext.override(Ext.data.DirectProxy, {
createCallback: function(action, reader, cb, scope, arg) {
return {
callback: (action == 'load') ? function(result, e) {
if (typeof result == 'string') {
result = Ext.decode(result);
}
if (!e.status) {
this.fireEvent(action + "exception", this, e, result);
cb.call(scope, null, arg, false);
return;
}
var records;
try {
records = reader.readRecords(result);
}
catch (ex) {
this.fireEvent(action + "exception", this, e, result, ex);
cb.call(scope, null, arg, false);
return;
}
this.fireEvent(action, this, e, arg);
cb.call(scope, records, arg, true);
} : function(result, e) {
if (typeof result == 'string') {
result = Ext.decode(result);
}
if (!e.status) {
this.fireEvent(action + "exception", this, e);
cb.call(scope, null, e, false);
return;
}
this.fireEvent(action, this, result, e, arg);
cb.call(scope, result, e, true);
},
scope: this
}
}
});

evant
13 May 2009, 3:28 PM
Yeah, it's a bug. It's since been fixed in SVN.

LisburnLad
14 May 2009, 1:59 PM
Hi shibubh,

Could I just check that I'm using your example correctly? I downloaded and unzipped the file, then went to the Example directory in the project and ran the Tree.aspx file - unfortunatley no tree appeared, only a border.

Should the tree be there or do I need to do something else?

Thanks,
Steve

shibubh
18 May 2009, 7:09 PM
Tree example is not yet ready. but you can check the organizer example

shibubh
20 May 2009, 12:38 AM
Update on 20 may 2009

1.Change in Direct Core
2.new Example added ( forum, pagging)

http://ny504427.bizhostnet.com/Direct.zip

View Example OnLine
http://ny504427.bizhostnet.com

shibubh
20 May 2009, 10:16 PM
added new example

row editor (Direct Store)

http://ny504427.bizhostnet.com/ (http://ny504427.bizhostnet.com/)

download sample
http://ny504427.bizhostnet.com/Direct.zip

LisburnLad
21 May 2009, 1:00 AM
Hi - I was wondering if anyone had been able to view these examples in IE7?

When I try it things like grid paging and updating don't work (for example, in the new row editor example, the cells cannot be edited when using IE7).

Using Firefox everything seems to work fine.

andycramb
21 May 2009, 4:55 AM
I am using IE6 and the rowEditor is not displaying as it should
When it displays there is no row to edit and all you see are the "update" and "cancel" buttons(see attachment)
My issue I suspect could be down to my privacy settings on IE6 not allowing s.gif to be requested from a different domain http://extjs.com/s.gif

Could you be having a similar issue?

evant
21 May 2009, 5:07 AM
No, there's a bug with the row editor that has since been fixed. Please don't hijack these threads with JS type questions :)

andycramb
21 May 2009, 5:28 AM
If that was
Please don't hijack these threads with JS type questions was aimed at me there was no intention to. I just happened to see a similar issue on IE6 and was genuinely trying to help :)

shibubh
21 May 2009, 7:56 AM
i have used console.log() in lots of code. i think thats why you getting error. i forget to remove it. and about row editor.its a bug.

shibubh
21 May 2009, 10:25 PM
i have just created the project template for the ExtjsDirect.

download
http://ny504427.bizhostnet.com/ExtDirectTemplate.zip

djMax
3 Jun 2009, 2:29 AM
Why use the NewtonSoft JSON library as opposed to Microsoft's?

zihotki
27 Jul 2009, 6:23 AM
Why use the NewtonSoft JSON library as opposed to Microsoft's?
JsonNet is more tunable in comparison with MS implementation. I used MS one previously on one of my projects but not so far ago I switched to JsonNet due to some limitations and problems of MS lib.

thomson
28 Aug 2009, 1:29 AM
Hello All,
i copied your code and started testing the Grid, In you code there was an override for data proxy , When i used Ext 3.0 there was a problem, Is there any thing do we need to do in 3.0

Regards

Thomson

b_rajus
31 Aug 2009, 3:39 AM
Hi Every one I'm new to this ExtJS. First time im implement the Row-Editor grid. But I was totally confused and unable to do it. Can any body give me a sample code of row-editor (only row-editor not with entire extjs) and I want this row-editor grid in .Net where I can get the values from Database through Dataset and assign to this Grid.

Thanks in Advance - Raju

jay@moduscreate.com
31 Aug 2009, 3:41 AM
Hi Every one I'm new to this ExtJS. First time im implement the Row-Editor grid. But I was totally confused and unable to do it. Can any body give me a sample code of row-editor (only row-editor not with entire extjs) and I want this row-editor grid in .Net where I can get the values from Database through Dataset and assign to this Grid.

Thanks in Advance - Raju

Working with editable grids in general is what I would consider somewhat advanced. There is a grid FAQ in http://extjs.com/learn, which will cover the basics of using datagrids. once you have an understanding of the basics, you can then layer editing on top of it.

saadkhan
25 Feb 2010, 7:45 AM
This is ridiculious...........When I tried to put my dummy own method in EchoHandler.aspx.cs file just to test, it didnt work. Only preset methods that you have made are working!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
No need for this kind of ExtDirect man!