Why won't this checkbox refresh as expected in Meteor? - meteor

I'd like to simplify the TodoMVC app for meteor. There is currently some observe that should not be needed I think. I simplified a bit successfully, but when I try to simplify it further the updating doesn't work properly.
For instance, it should get selected when I click on all the items in the todo list but doesn't. When I refresh the page it is selected though.
Edit: Got rid of an unrelated error, thanks to #TomColeman.

I'm seeing that error before the patch is applied. It's due to the Meteor.flush on line 74.
I'm not sure why that flush is needed? (I'm also not sure why there's an error either).

Turns out it simply was because the correct html is checked="checked", not simply checked.

Related

Issue in ParamQuery Grid Inline Edit

We are using ParamQuery grid in our project.
In one of our screen, we are using the grid in modal popup with inline edit feature.
We are facing issue on editing the cell from second time. Here are the steps followed,
Open the popup, first time, tried to edit a record – it is perfectly changed and updated.
Now close and re-open the modal popup.
Try to change the data and update - It is not updating any data. Changed data gets vanished by retaining the previous value.
On debugging the code,
a. We are getting false in the following code snippet while updating the data,
if (grid.saveEditCell() == false) {
return false;
}
b. We are also getting the script error,
pqgrid.min.js:188 Uncaught TypeError: Cannot read property 'split' of undefined(…)
As of now, we are using the workaround,
“After updating the data 1st time, we are re-loading (using window.location.reload()) the page. Now it is working correctly. But in Ajax world, we don’t want to reload the full page, just to solve this issue. We believe, that this is because of some small issue or configuration missing.”
Referred the following article and implemented the inline edit functionality http://paramquery.com/pro/demos/editing
Appreciate your help.

Emberjs CollectionView changes from 0.9.7.1 to 1.0.pre?

I had some code that connected an ArrayController with CollectionView that no longer works once I upgrade to 1.0.pre.
It seems that CollectionView no longer passes each element of the collection to its template view class?
I've distilled my issue to this jsFiddle: http://jsfiddle.net/chaodoze/CbwCN/
Notice it outputs to "1,2,3" on each line in 1.0.pre
In 0.9.7.1, it outputs correctly as a single digit on each line.
Am I doing something wrong here or is this a bug?
What is the best way to work-around this issue?
Thanks!
In 1.0.pre the view's context has changed. When you access {{content}} you are really accessing {{controller.content}}, which is [1,2,3]. You need to access the view's content, which in the individual number, that is done with {{view.content}}.
See http://jsfiddle.net/CbwCN/2/

Why is my cache item not nulled after Cache.Remove call?

I'm trying to remove a specific item from the ASP.NET Cache in order to force a reload. Something like this:
System.Web.HttpContext.Current.Cache.Remove(SomeKey);
But then I check it immediately afterward, and Cache[SomeKey] is NOT null. It still contains a reference to this item I want to clear. Am I missing something obvious here?
OK, I figured it out... turns out I had a property in my Watch debug window, which had a side effect of priming the cache. So even though I was looking at the Cache object it was actually being instantly updated with a new value every time it was cleared. Embarrassing.

Sizzle Selector Engine Error

I'm attempting to use jQuery and ASP.NET. I am pasting the server control "ClientID" into a jQuery selector and I'm getting an error (with no error text) from the Sizzle selector engine.
My selector looks like this...
$('#ctl00_ContentPlaceHolder1__phProfileHeader__filProfileImage')
Is it the length that might be causing the problem? I've re-checked the control ID several times in the client code and everything seems fine. So what's the deal? I use the same strategy in several other places and they work fine.
That's pretty strange. Something that I have seen used when dealing with those long ASP.NET generated IDs is jQuery's content filters. For example, this one will look for element's who's id attribute ends with "filProfileImage":
$("[id$=filProfileImage]")
Try that and see if it helps.
http://docs.jquery.com/Selectors/attributeEndsWith#attributevalue
Are you sure the error is happening in Sizzle?
I would check to see what you get with
document.getElementBy('ctl00_ContentPlaceHolder1__phProfileHeader__filProfileImage');
just to make sure the dom is available. Not that sizzle should care, but...
Please post your error message.
Cheers
I don't get any errors. I don't think is jQuery related. Can you pass the error?
$(document).ready( function(){
console.log( $('#ctl00_ContentPlaceHolder1__phProfileHeader__filProfileImage'));
});
Returns the div.

RadioButtons, ListViews, and Grouping, oh my!

I've got a project I'm working on where I need to put a RadioButton inside a ListView, and have them all have the same GroupName. (can't use RadioButtonList, long story).
Anyway, this seems to be a well known bug in .NET, so I've implemented the solution found here:
ASP.NET RadioButton messing with the name (groupname)
This works perfectly, but with one small bug which undoubtedly will come back to bite me. If I click one radio button, and then click another while the javascript function is still running and has not completed; I can get 2 radiobuttons in the same group selected.
Any ideas? If you need clarification; leave me a comment and I'll update my post.
EDIT: I believe I fixed my own issue here. See my posted answer below.
Would something like this work?
if (!rbClicked)
rbClicked=True;
runJavascript();
rbClicked=False;
I admit I didn't do alot of research, but this is how I've usually solved this type of problem.
Turns out I was misguided here.
Later on in the page lifecycle; I was adding an additional onclick event that was overwriting the previous value.
In the following example:
var radiobutton = new System.Web.UI.WebControls.RadioButton();
radiobutton.Attributes.Add("onclick", "test1");
radiobutton.Attributes.Add("onclick", "test2");
the onlcick attribute is set to "test2"; test1 is lost.
I ended up fixing it by appending to the existing attribute; see below:
radiobutton.Attributes["onclick"] = string.Format("{0};{1}", radiobutton.Attributes["onclick"], "My Second Script");
This works without issue.

Resources