Strange problem with jsclr

21 views
Skip to first unread message

zdenek hostinsky

unread,
May 29, 2015, 10:39:39 AM5/29/15
to shar...@googlegroups.com
Hello

I'm using jsclr together with extjs and today I found strange issue
Basically dropdowns in ExtJs does not work as expected and everything started working fine as soon as I removed the jsclr (concretelly Compile() method) from the project
of course I cannot do that (hope there is another way) so I started to inveestigate what compile is doing

It seems to be definyng .NET classes in C# and additionally it seems to overwriting existing objects ( concretelly date, array) those two seems to be problemtic one

Just to give me some pointers can you describe what exactly Compile is doing in few words and what it does with existing methods/objects

Thanks
Zdenek

Dan-el Khen

unread,
May 29, 2015, 10:43:06 AM5/29/15
to shar...@googlegroups.com
Hi Zdenek,

If you're able to create a small html/js sample that reproduces this issue I can take a look at it. jsclr isn't supposed to overwrite existing types, only to extend them. The best way would be to reproduce this in a small sample and debug it. Can you create such a sample?

Cheers
D.




--
You received this message because you are subscribed to the Google Groups "SharpKit Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sharpkit+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

zdenek hostinsky

unread,
May 29, 2015, 1:51:09 PM5/29/15
to shar...@googlegroups.com
Hello

I cannot attach files here ( for some reason it hangs, so I'm copypasting html file below

you need
1. replace link to jsclr.js on line 15
then to reproduce my problem

1. display the page, type "alb" into the combo - you will see states filtered, delete "al" and type something else for example "t". Combo will stay empty
2. comment out "Compile()" call
repeat one - and you will see that after "al" and then changing to "t" the texas will be displayed. So Compile must influence something

thanks for help





html file:




<!DOCTYPE html>

<html>
<head>
<link type="text/css" rel="stylesheet" href="http://ams-test.allynintl.eu/extnet/resources/css/extnet-all-debug-embedded-css/ext.axd?v=38759" id="extnet-styles" />
<script type="text/javascript" src="http://ams-test.allynintl.eu/extjs/ext-all-debug-js/ext.axd?v=38759"></script>
<script type="text/javascript" src="http://ams-test.allynintl.eu/extnet/extnet-all-debug-js/ext.axd?v=38759"></script>
<title>
Basic Row Command - Ext.NET Examples
</title>

<script src="../Scripts/Sharpkit/jsclr.js" type="text/javascript"></script> <!-- replace this one-->

<script>
//debugger;
Compile();
</script>
<script>
var template = '<span style="color:{0};">{1}</span>';

var change = function (value) {
return Ext.String.format(template, (value > 0) ? "green" : "red", value);
};

var pctChange = function (value) {
return Ext.String.format(template, (value > 0) ? "green" : "red", value + "%");
};
</script>

<script type="text/javascript">
//<![CDATA[
Ext.net.ResourceMgr.init({ id: "ctl03", aspForm: "ctl01", appName: "AMS", locale: "en-US" }); Ext.onReady(function () { Ext.create("Ext.panel.Panel", { renderTo: "App.ctl04_Container", items: [{ id: "ctl05", width: 320, xtype: "combobox", fieldLabel: "Select a single state", labelWidth: 130, displayField: "name", queryMode: "local", store: { model: Ext.ClassManager.isCreated(Ext.id()) ? Ext.id() : Ext.define(Ext.id(), { extend: "Ext.data.Model", fields: [{ name: "abbr" }, { name: "name" }, { name: "slogan" }] }), storeId: "ctl06", autoLoad: true, data: [["AL", "Alabama", "The Heart of Dixie"], ["AK", "Alaska", "The Land of the Midnight Sun"], ["AZ", "Arizona", "The Grand Canyon State"], ["AR", "Arkansas", "The Natural State"], ["CA", "California", "The Golden State"], ["CO", "Colorado", "The Mountain State"], ["CT", "Connecticut", "The Constitution State"], ["DE", "Delaware", "The First State"], ["DC", "District of Columbia", "The Nation's Capital"], ["FL", "Florida", "The Sunshine State"], ["GA", "Georgia", "The Peach State"], ["HI", "Hawaii", "The Aloha State"], ["ID", "Idaho", "Famous Potatoes"], ["IL", "Illinois", "The Prairie State"], ["IN", "Indiana", "The Hospitality State"], ["IA", "Iowa", "The Corn State"], ["KS", "Kansas", "The Sunflower State"], ["KY", "Kentucky", "The Bluegrass State"], ["LA", "Louisiana", "The Bayou State"], ["ME", "Maine", "The Pine Tree State"], ["MD", "Maryland", "Chesapeake State"], ["MA", "Massachusetts", "The Spirit of America"], ["MI", "Michigan", "Great Lakes State"], ["MN", "Minnesota", "North Star State"], ["MS", "Mississippi", "Magnolia State"], ["MO", "Missouri", "Show Me State"], ["MT", "Montana", "Big Sky Country"], ["NE", "Nebraska", "Beef State"], ["NV", "Nevada", "Silver State"], ["NH", "New Hampshire", "Granite State"], ["NJ", "New Jersey", "Garden State"], ["NM", "New Mexico", "Land of Enchantment"], ["NY", "New York", "Empire State"], ["NC", "North Carolina", "First in Freedom"], ["ND", "North Dakota", "Peace Garden State"], ["OH", "Ohio", "The Heart of it All"], ["OK", "Oklahoma", "Oklahoma is OK"], ["OR", "Oregon", "Pacific Wonderland"], ["PA", "Pennsylvania", "Keystone State"], ["RI", "Rhode Island", "Ocean State"], ["SC", "South Carolina", "Nothing Could be Finer"], ["SD", "South Dakota", "Great Faces, Great Places"], ["TN", "Tennessee", "Volunteer State"], ["TX", "Texas", "Lone Star State"], ["UT", "Utah", "Salt Lake State"], ["VT", "Vermont", "Green Mountain State"], ["VA", "Virginia", "Mother of States"], ["WA", "Washington", "Green Tree State"], ["WV", "West Virginia", "Mountain State"], ["WI", "Wisconsin", "America's Dairyland"], ["WY", "Wyoming", "Like No Place on Earth"]], proxy: { type: 'memory', reader: { type: "array" } } }, listeners: { beforequery: { fn: function () { } } } }] }); });
//]]>
</script>
</head>
<body>
<form method="post" action="amstest1.aspx" id="ctl01">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE5OTg4MTgxNDdkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYDBQVjdGwwMwUFY3RsMDQFBWN0bDA1u/OEh2mZ/UFIVmgDVWxPsu/h3zZgKu1XZ8xZcSiatbk=" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['ctl01'];
if (!theForm) {
theForm = document.ctl01;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>


<div class="aspNetHidden">

<input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="B762C47F" />
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEdAAI4N4e/OOM1jQ/+9+LTlDSuNpGzZOwh9RDF3/tMV5ai8y7B3HzPbMXHwBf7SxlVMegOb1ZdzS7mWec1A71x2RRD" />
</div>


<h1>Basic Row Command</h1>

<br />

<h3>Icons with tips</h3>


<div id="App.ctl04_Container"></div>


</form>
</body>
</html>




Dne pátek 29. května 2015 16:43:06 UTC+2 Dan-El Khen napsal(a):

Dan-el Khen

unread,
Jun 1, 2015, 5:41:37 AM6/1/15
to shar...@googlegroups.com
Hi Zdenek,

Thanks for sending a great reproduction.

I found the culprit, seems that there was some function added on array called 'filter', which overrode the real one. I've updated the code on github, please grab jsclr.js from git and try again.

Let me know how it goes.

Cheers
D.

Zdenek Hostinsky

unread,
Jun 1, 2015, 5:03:02 PM6/1/15
to shar...@googlegroups.com

Thanks a lot

Problem solved

 

Thanks

Zdenek

--
You received this message because you are subscribed to a topic in the Google Groups "SharpKit Support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sharpkit/MFywp9nsp6k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sharpkit+u...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages