Where is submitChanges Method in Telerik.MVC.Grid - asp.net-mvc

I am using the Telerik.MVC.Grid (version 2013.2.611) from Nuget
The following script
function mouseDown(e)
{
var grid = document.getElementById("ColumnsEditor")
grid.submitChanges();
}
throws error:
Object doesn't support property or method 'submitChanges'
Documentation indicates this is a valid method. If the method is invalid, is there an alternative method to call.

The trick is getting the syntax correct. Once I got the grid properly typed, the submitChanges method shows in intellisense.
tGrid is the Type.
grdEditor is the grid name .
var grid = $('#grdEditor).data('tGrid');
grid.submitChanges();

Related

Deedle, F# and read csv

I am facing an issue when I try to use the function Deedle.Frame.ReadCsv
I am trying to use the overload here: https://collective2.com/c2explorer_help/html/806c0295-1a9f-1bf4-50eb-a221419abe06.htm
let schemaSource = "dateRep (DateTime),,,,,,,,,"
let dataSource = Deedle.Frame.ReadCsv(path = "data.csv", schema = schemaSource)
When I do so, I get the following error:
error FS0503: A member or object constructor 'ReadCsv' taking 0 arguments is not accessible from this code location. All accessible versions of method 'ReadCsv' take 9 arguments.
What I do not get is that all but path are optional. If I use just:
Deedle.Frame.ReadCsv("data.csv")
It then works...
Any idea? I tried to find some resources on using overloaded functions from other .Net languages with optional parameters but I have not been successful.
I am not sure why the Intellisense/Signature shown in Visual Studio was wrong but using location = works...

IOS/Objective-C: Shared Instance Method with argument

Hi I have a class that I am lazyloading as a sharedInstance. I would like to be able to call a method in the class that requries an input variable but the following syntax is not working. It says there is no such property but I copied the property from the interface.
Here is code that is not working
int myPoints = 200;
//myStatusLevel is a method in ManagePoints that takes mypoints as an input
// its signature is (int)myStatusLevel: (int) points;
//the following line gives error prperty myStatusLevel not found
int myStatusLevel =[ManagePoints sharedInstance].myStatusLevel:myPoints;
Can this be done and, if so, what is the proper syntax? Thanks in advance for any suggestions.
If there is a method in ManagePoints with the following signature:
-(int)myStatusLevel:(int)points;
then you should be able call that function and pass an argument.
You need to use square brackets:
int myStatusLevel = [[ManagePoints sharedInstance] myStatusLevel:myPoints];

ServiceStack ORM Lite calling a stored procedure with more than one parameter

I am using ORM Lite's .SqlList method to call a stored procedure and map the results to my custom object. When I am using only one parameter, and calling the stored procedure as follow it works fine:
var results = conn.SqlList<CustomObject>("EXEC MyStoredProcedure #paramOne"), new { paramOne = "someParam" });
When I want to call a stored procedure with more than one parameter and I call it as shown bellow I get an error stating that "The given key was not present in the dictionary.".
var results = conn.SqlList<CustomObject>("EXEC MyStoredProcedure #paramOne, #paramTwo"), new { paramOne = "someParam", paramTwo = "someOtherParam" });
I had a look at the sql stored procedure test page on the ORM Lite Github repo but it does not show how to call stored procedures with more that one param.
Thanks.
EDIT:
I should add that the second parameter on the sql side is a custom table type, and I am sending in a DataTable type in C#.

Possible bug in getValidationMessages

I've created a custom entity level validation function, very similar to the one in the documentation (http://www.breezejs.com/documentation/validation). When I call getValidationErrors(), I get the following error:
Cannot read property 'name' of undefined
The error is coming from:
proto.getValidationErrors = function (property) {
assertParam(property, "property").isOptional().isEntityProperty().or().isString().check();
var result = __getOwnPropertyValues(this._validationErrors);
if (property) {
var propertyName = typeof (property) === 'string' ? property : property.name;
result = result.filter(function (ve) {
**return (ve.property.name === propertyName);**
});
}
return result;
};
There is no 'property' field in the custom entity level validator context. I'm using Breeze 1.4.5. Is this a bug? It seems to me the code above should check for 've.property', before trying to access the name.
Update
This has been fixed as of Breeze 1.4.7, available now.
Previous Post:
This is a bug that has already been fixed on GitHub and will be part of the next release (Breeze 1.4.7) out sometime next week. Or you can pull the breeze.xxx.js file from GitHub now if you need the fix earlier.

Breeze isPartial

Currently playing with John Papa's Hot Towel, I am currently having a strange error:
TypeError: Object [object Object] has no method 'isPartial'
I have been looking into this isPartial thing but without success.
All I've done is create a new kind of entity.
I don't know if I should provide more information for this problem.
Please help!
Thanks :)
Here's the full error below:
"TypeError: Object [object Object] has no method 'isPartial'
at proto.setProperty (http://localhost:13763/scripts/breeze.debug.js:13153:31)
at http://localhost:13763/scripts/breeze.debug.js:5833:30
at Object.objectForEach (http://localhost:13763/scripts/breeze.debug.js:311:17)
at proto.createEntity (http://localhost:13763/scripts/breeze.debug.js:5832:22)
at proto.createEntity (http://localhost:13763/scripts/breeze.debug.js:9876:18)
at dtoToEntityMapper (http://localhost:13763/App/services/breeze.partial-entities.js:32:38)
at Array.map (native)
at Object.mapDtosToEntities (http://localhost:13763/App/services/breeze.partial-entities.js:23:25)
at querySucceeded (http://localhost:13763/App/services/datacontext.js:64:42)
From previous event:
at Object.getMyEntities (http://localhost:13763/App/services/datacontext.js:60:18)
at Object.activate (http://localhost:13763/App/viewmodels/home.js:6:32)
at activate (http://localhost:13763/App/durandal/viewModel.js:74:38)
at Object.<anonymous> (http://localhost:13763/App/durandal/viewModel.js:231:37)
at Object.<anonymous> (http://localhost:13763/scripts/jquery-1.9.1.min.js:3:9221)
at c (http://localhost:13763/scripts/jquery-1.9.1.min.js:3:7857)
at Object.p.add [as done] (http://localhost:13763/scripts/jquery-1.9.1.min.js:3:8167)
at Array.<anonymous> (http://localhost:13763/scripts/jquery-1.9.1.min.js:3:9198)"
Would need more info to diagnose. Is the new type in metadata? Did you create a custom constructor for your type that defines isPartial, as CCJS does in model.js ~ln #36?
// Pass the Type, Ctor (breeze tracks properties created here), and initializer
metadataStore.registerEntityTypeCtor(
'Session', function () { this.isPartial = false; }, sessionInitializer);
You can find out if you've successfully added a property to a type by following this example based on a test method in "entityExtensionTests" of the DocCode sample:
function assertFooPropertyIsUnmappedPropertyOfCustomer(manager) {
var custType = manager.metadataStore.getEntityType("Customer");
var fooProp = custType.getDataProperty('foo');
ok(fooProp && fooProp.isUnmapped,
"'foo' property should be defined as unmapped property after registration.");
}
Btw, in the forthcoming Breeze v.1.3.2 there is much easier way to map partials - flat projections like these - into an EntityType using EntityQuery.toType(). You would still need to add isPartial to the type.
I had same issue and I needed to clear my browser cache as it had not got my updated model.js file in which I'd just added a new metadataStore.registerEntityTypeCtor for an entity.

Resources