I have this code which work correctly in extjs 3.4
I want to migrate this code in order to be worked in extjs 4.2
Ext.apply(this.menu.picker, {
minDate : this.minValue,
maxDate : this.maxValue,
disabledDatesRE : this.disabledDatesRE,
disabledDatesText : this.disabledDatesText,
disabledDays : this.disabledDays,
disabledDaysText : this.disabledDaysText,
format : this.format,
showToday : this.showToday,
startDay: this.startDay,
minText : String.format(this.minText, this.formatDate(this.minValue)),
maxText : String.format(this.maxText, this.formatDate(this.maxValue)),
field: this
});
when I test this code I find error in this line :
minText : String.format(this.minText, this.formatDate(this.minValue)),
maxText : String.format(this.maxText, this.formatDate(this.maxValue)),
Uncaught TypeError: Object function String() { [native code] } has no method 'format'
franco, have you tried
Ext.String.format(params)
instead of String.format() ?
Best
Rajinder
Related
Hi I am wondering why the custom events I have set up don't seem to be showing on flurry.com portal.
I am going to guess it has something to do with how I have set it up - but according to the flurry documentation I have done it correctly.
This is the result when I click a button that fires logEvent
msg = <FlurryStreamEvent: 0x28350e000, type = 134, json = { "fl.event.type" : "CUSTOM_EVENT", "fl.event.id" : 2, "fl.timed.event.duration" : 0, "fl.event.timed" : false, "fl.event.uptime" : 2284321185, "fl.timed.event.starting" : false, "fl.event.user.parameters" : { "RXBpc29kZV90aXRsZQ==" : "WW91ciBTbyBTdHVwaWQ=", "cG9kY2FzdA==" : "Mm5lcmRzIEluIEEgUm9vbQ==" }, "fl.event.name" : "UG9kY2FzdF9QbGF5", "fl.frame.version" : 1, "fl.event.flurry.parameters" : { }, "fl.event.timestamp" : 1603026151045 }>
My concern is "fl.event.flurry.parameters" : { }, it's empty - I have no idea if it is meant to be empty..
This is how I am calling it:
let data = ["podcast": post.title, "Episode_title":podcast.title]
Flurry.logEvent("Podcast_Play", withParameters: data)
fl.event.user.parameters is the one that contains the parameters you set, so in your example, they are reporting in. Not seeing them in the portal could be due to the expected time it takes for data to propagate. If it takes more than several hours, email us at support#flurry.com with the details.
I don't know why this get an error.
I should take from local-mongodb library a new _id of my future new postIt and run new page but in "this.props.onInsertNewPost(idPost);" it get an error (Cannot Read property idPost undefined).
onInsertNewPost call a redux function that set "id" in the initialState.
I tried using binding (this.idPost=this.idPost.bind(this)) anche call idPost() function in componentWillMout, but it get the same problem
componentWillMount(){
return new Promise((resolve,reject)=>{
setTimeout(()=>{
db.loadDatabase(err=>{
var obj={
year : this.state.year,
month : this.state.month,
day : this.state.day,
houre : this.state.houre,
minute : this.state.minute,
text : '',
isSelected : false,
imagesStored : []
};
db.insert(obj,function(err,doc){
let docDoc=JSON.stringify(doc);
let parseDoc=JSON.parse(docDoc);
console.log(parseDoc._id);
idPost=parseDoc._id;
this.props.onInsertNewPost(idPost);
console.log('create nuovo post');
resolve('componentDidMoutnewPostit');
});
});
},100);
});
};
I think this problem occured because idPost is global.
if you pass parseDoc._id directly into your onInsertNewPost function it should work.
componentWillMount(){
return new Promise((resolve,reject)=>{
setTimeout(()=>{
db.loadDatabase(err=>{
var obj={
year : this.state.year,
month : this.state.month,
day : this.state.day,
houre : this.state.houre,
minute : this.state.minute,
text : '',
isSelected : false,
imagesStored : []
};
db.insert(obj,function(err,doc){
let docDoc=JSON.stringify(doc);
let parseDoc=JSON.parse(docDoc);
console.log(parseDoc._id);
this.props.onInsertNewPost(parseDoc._id);
console.log('create nuovo post');
resolve('componentDidMoutnewPostit');
});
});
},100);
});
};
I am developing angularjs nodejs application
Following has Payment Collection find function and result
var collectionId = "5673d6c7da28e94f51277894"
Payment.find({id: collectionId}).exec(function(err,payment)
console.log(payment);
);
Console result :
{
"_id" : ObjectId("5673d6c7da28e94f51277894"),
"response" : {
"status" : "approved",
"id" : "PAY-9N740711P28316116KZX5U4I"
}
}
I need to find payment collection using response id
My code here
var paymentId = "PAY-9N740711P28316116KZX5U4I"
Payment.find({ response : {id: paymentId}}).exec(function(err,payment)
console.log(payment);
);
Console result :
undefined
If you are not clear question, please comment
Hope answer, thanks
It should be:
Payment.find({ 'response.id': paymentId }).exec(function(err,payment) {
console.log(payment);
});
I'm having a lot of trouble getting query results for certain collections in Meteor.
I have set
idGeneration : 'MONGO'
in the collection definitions, and in the mongo shell these collections look like this :
the document i want, call it documentW (from CollectionA) = {
"_id" : ObjectId("7032d38d35306f4472844be1"),
"product_id" : ObjectId("4660a328bd55247e395edd23"),
"producer_id" : ObjectId("a5ad120fa9e5ce31926112a7") }
documentX (from collection "Products") = {
_id : ObjectId("4660a328bd55247e395edd23")
}
documentY (from collection "Producers") = {
_id : ObjectId("a5ad120fa9e5ce31926112a7")
}
If i run a query like this in Meteor
CollectionA.findOne({ product_id : documentX._id, producer_id : documentY._id})
I'm expecting to get my documentW back... but I get nothing.
When I run this query in the mongo shell
db.collectiona.find({ product_id : ObjectId("4660a328bd55247e395edd23"), producer_id :
ObjectId("a5ad120fa9e5ce31926112a7") })
I get my documentW back no problem.
Of course in Meteor if I call
console.log(documentX._id)
I get this
{ _str : "4660a328bd55247e395edd23" }
Anyone have any ideas what is going on here ? I have tried all kinds of things like
Meteor.Collection.ObjectID(documentX._id._str)
but the search still returns empty...
Running the latest 0.7.0.1 version of Meteor...
I don't know if this answers your question, but I can't put this code in a comment. This code is working for me, trying to follow what I believe you are trying to do:
Products = new Meteor.Collection("products", {
idGeneration: "MONGO"
});
Producers = new Meteor.Collection("producers", {
idGeneration: "MONGO"
});
CollectionA = new Meteor.Collection("a", {
idGeneration: "MONGO"
});
Products.insert({
foo: "bar"
});
Producers.insert({
fizz: "buzz"
});
var documentX = Products.findOne();
var documentY = Producers.findOne();
CollectionA.insert({
product_id: documentX._id,
producer_id: documentY._id
});
var documentW = CollectionA.findOne({
product_id: documentX._id,
producer_id: documentY._id
});
console.log(documentW); // This properly logs the newly created document
This is on 0.7.0.1. Do you see anything in your code that diverges from this?
I have a MongoDB Colllection which has following data
> db.UpdateQueryRegistry.find({"studyId" : "20130117193010cfab"})
{ "_id":ObjectId("50f95af799ac247d280484dc"),
"attempts":0,
"eTime": ISODate("2013-01-17T17:03:36.501Z"),
"lastUpdDt": ISODate("2013-01-18T14:23:51.141Z"),
"numQueries":1,
"query":"Q1",
"sTime":null,
"start":0,
"status":"COMPLETED",
"studyId":"20130117193010cfab",
"updateAction":"convertToIUorNO",
"updateSource":"DOCUMENTSTATUS"
}
{ "_id":ObjectId("50f95af799ac247d280484db"),
"attempts":0,
"eTime": ISODate("2013-01-17T19:50:34.392Z"),
"lastUpdDt": ISODate("2013-01-18T14:23:51.141Z"),
"numQueries":1,
"query":"Q2",
"sTime":null,
"start":0,
"status":"COMPLETED",
"studyId":"20130117193010cfab",
"updateAction":"instanceAddQuery",
"updateSource":"ONTOLOGY"
}
{ "_id":ObjectId("50f95af799ac247d280484da"),
"studyId":"20130117193010cfab",
"updateSource":"ONTOLOGY",
"updateAction":"instanceDeleteQuery",
"query":"Q3",
"sTime":null,
"eTime":null,
"status":"PENDING",
"numQueries":0,
"lastUpdDt": ISODate("2013-01-18T14:23:51.141Z"),
"attempts":0,
"start":0
}
The index is created on DB as follows:
> db.UpdateQueryRegistry.stats().indexSizes
{
"_id_" : 8176,
"studyId_1_status_1" : 24528,
"studyId_1_updateSource_1_updateAction_1_query_1" : 98112
}
But when I fire query
db.UpdateQueryRegistry.find({
"studyId" : "20130117193010cfab",
"updateSource" : "ONTOLOGY",
"updateAction" : "instanceDeleteQuery"
})
I do not get any results but when I fire query
db.UpdateQueryRegistry.find({
"studyId" : "20130117193010cfab"
})
I see 3 results displayed above. Please tell me if there is any error in this.