« first day    last day (1778 days later) » 

12:00 AM
be careful with find.remove though, because find can match multiple elements.
If you only want the first match you can use
$(parent).find(`.child:first`).remove();
 
The id is dynamic.. so that should be grand right?
By that I mean it should be unique..
By that I mean it should be unique..
 
I WANT TO SLEEP
 
omg a double post!
A FULL DOUBLE POST!
@LewsTherin - If you are using an id as a selector then there is no risk of a multiple match.
 
@TravisJ Bad network on my end.. oops
@RudiVisser So do I, but I won't be sleeping in a long while..
 
I thought it was rad
 
12:09 AM
Is it not supposed to happen?
Oh I see
Lol!
 
wtf are you dooinng
 
lol
Delete * From Messages
 
It's @Pheonixblade9 with a one liner again! :D
 
@RudiVisser All I have is one liners! I NEED TO CONTRIBUTE SOMEHOW
 
12:22 AM
@Pheonixblade9 Do you know ASP.NET MVC? :D
Argh, bedtime
Glad this room "took off" so quickly, we had a real question within an hour! :D
Good night @LewsTherin @E.LDunn @TravisJ @Pheonixblade9 @RoelvanUden, etc :)
 
Goodnight dude!
 
Thought it was EL not Travis up there my eyes are dying, g'night
 
@RudiVisser yeah, I do know it
night
 
 
8 hours later…
8:50 AM
Morning
Ah we have a @Billdr! Hello ^_^
 
9:27 AM
good night and good morning rudi :P
 
^_^
 
morning
 
hi @RudiVisser
 
Morning @Steve did you manage to fix it?
 
I didn't get that images package
 
9:36 AM
// <auto-generated>
//    This code was generated from a template.
Awww that's nowhere near as good as This code was generated by a tool.
But @steve as I said yesterday you already have it ^_^
If you save/export your site from that Web Plus thing, it will have all of the images there
 
ok @RudiVisser
 
9:56 AM
@RudiVisser I am trying jquery tabs,i have downloaded jquery 1.10.0 from package from jquey website.I have included the script files but the tabs are not loading
 
Any JS errors?
 
tabs are not displying
I have included <link href="~/jquery-ui-1.10.0/themes/base/jquery-ui.css" rel="stylesheet" />
<script src="~/jquery-ui-1.10.0/ui/jquery-ui.js"></script>
<script src="~/Scripts/jquery.1.8.3.js"></script>
 
Okay, any JS errors? and are your scripts definitely in the correct place?
Also note that jQuery should come before jQuery UI
 
10:37 AM
@RudiVisser got it tabs are displaying
 
Brilliant :)
 
10:52 AM
Hi yourself, @RudiVisser.
 
Heyya y'all
 
morning duders
Johan invited me to crash your party. Sorry about that.
 
lol
 
It happens.
 
11:05 AM
Morning @RoelvanUden
 
Hi guys can someone help me out,
http://stackoverflow.com/questions/13269623/mvc-3-razor-pass-webgrid-row-data-to-controller-using-actionlink
 
I'm pulling it up now Sud.
While we wait, my lead's made a pair of classes that look like these: gist.github.com/4620112
 
@SudhakarByna You've already accepted an answer?
 
@RudiVisser It's not even his question
 
They have to be that way, because he says so. JSON gets caught in an infinite loop, for obvious reasons. How can I correct that?
 
11:09 AM
goes back to sleep
 
sorry buddy , could check this link
http://stackoverflow.com/questions/14499626/adding-a-link-button-in-the-footer-of-webgrid-mvc3
 
@Billdr Oh wow that's amazing.
 
@SudhakarByna You want the save all to be at the bottom of this grid thing?
@Sean You'd think.
 
@Billdr Lazy load the reference back.
 
He seems to believe including that explicit reference gives him super powers.
 
11:12 AM
public virtual Foo Foo { get; set; }
 
I tried that one @RoelvanUden, but that just pushes the problem out to my JS.
Now that might do the trick.
 
It won't be included in the JSON back, for obvious reasons you'd get that infinite loop, as you'd pointed out. So you'll need to handle that in your JS side of things.
 
Hi guys, can someone help me
stackoverflow.com/questions/…
 
@SudhakarByna Hah. Almost posted that link correctly :3
 
stackoverflow.com/questions/…
 
11:14 AM
@SudhakarByna Only if you answer my request for more information.
 
offcourse i posted that one
 
ah, saw the update.
And posted a link to the information you need.
 
Oooh Billdr a link answer
 
Is there a good library to serialize JSON indented?
 
You badboi
 
11:19 AM
I could rewrite what ASP.NET posted, or I could answer his question and boost the target page's search relevance so the next person might not have to ask a question that has a documented answer.
Also, 90% of my answers are link answers. The answers are out there, people just need to google++;
 
@RudiVisser Owned.
 
177
Q: Are answers that just contain links elsewhere really "good answers"?

romandasI have often wondered at the practice on SO, SF, and the other sites where someone will ask a question and an answer will come in that says Look here: http://link elsewhere. Rarely will the link have exactly the answer necessary -- often it's an entire article -- yet these answers get voted up. ...

 
Yea, I know it's frowned on. I'm a rebel.
@SudhakarByna My answer's bunk. I'm fixing it.
 
Yea you better
 
actually, no
I was right. Force it in with css, or force it in with javascript. There isn't a better route provided.
 
12:23 PM
Hey..
 
hey @LewsTherin
 
lews!!
 
Hey guys..
Dunn.. you abandoned the C# room huh? :P
I thought you stopped visiting SO
 
I think most of us here did lol
 
no just dont go in c# anymore :)
 
12:32 PM
Lol
 
cant abandon SO im addicted
 
The room has lost its way admittedly..
@E.LDunn Same.. even if I am not actively chatting, a tab is open.
So question time: how do I bind a checkbox group to property in a model?
Still reading the specs on @Html.CheckBoxFor
 
CheckBoxFor(m => m.wtf)?
 
Yeah, not sure how to make it work for a group.. I am guessing I have to pass a htmlattribute instance
To give the checkboxes the same name
Oh... looking at the source, I don't think so.. mmn
 
CheckBoxFor(m => m.wtf, new { name = "wtf[]" })
I'm not really sure what's happening here
I've never dealt with a checkbox group going to an array on a model; assuming that's what you're trying to do
 
12:42 PM
@LewsTherin Do you want a list of checkboxes where each checkbox is an item in a collection or array?
goddamnit rudi
stop asking my questions
 
Type faster
 
Lol
Nah, more like a list of selected items in a checkbox group
I think I am close to getting it working.. no biggie
 
So you want to receive it as string[] on the other side?
 
Yeah
Which means in my ajax variable I just pass in the array of selected items.. although I have to use some jquery filtering..
I think traditional will do the job of serializing it.
 
Ah, AJAX
 
12:45 PM
$.ajax indeed.
 
Well anyway, just force the name to PropName[]
That should work fine
 
I will try that thanks..
Another question I never really got an aswer to.
I am appending id's to identify which elements belongs to which user and to what category
Something like item#4343433#434343 blah
Do I parse the ids on the client or server side?
Does it matter?
I could send the string into the server and grep each id and do a query on that.
Or I could grep client side and send the ids as the action arguments
Either way both seem like too much effort.
Ok maybe not too much.
 
Why not POST over a whole array
username[1234]
username[4321]
etc
 
Rudi Visser has made a change to the feeds posted into this room
Rudi Visser has made a change to the feeds posted into this room
 
@RudiVisser ?
 
12:52 PM
?
 
???
 
Pretty much what you're doing; But pass it over as an array and pull out the values server side based on ID?
 
mmn so what would username[1234] store exactly?
I know its hard without context..
Would it be username[1234]=1234? :S
 
12:57 PM
username[1234] would be the username field in your form for the username of user 1234
 
brb..
 
2
Q: ReportViewer in MVC 4 partial

DoomsknightI am still unsure the best way to go about it. I've read alsorts of resources, yet still no closer to a working solution. I created a partial ASCX file. Added Report viewer to it, then rendered said partial in my CSHTML file. This was the closest I have come. In that I can see the report viewe...

0
Q: JQGrid Loading lots of data

Pareen VataniSITUATION I am using Trirand JQGrid for MVC[server side] in my proj. I've got more than 5 hundred thousand records in a single table. I load the data by calling this piece of code. this is what gives 500000 records collection. IEnumerable<myIndexViewModel> myviewmodel= _allincidents.Se...

1
Q: AsfMojo - asp.net MVC / Extract Frame from WMV C# Cache

user373721I am using AsfMojo (in a handler) in my MVC application to extract a bmp from WMV file, it works great on my localhost IIS7, however the image does not show when I publish the application to our hosting service. the view script: <img id="Image1" alt="image" src="ImageHandler.ashx?img=CT...

0
Q: ASP.NET MVC 4 currency field

Zdravko DanevI get an error ("The field Amount must be a number") on my web page on a currency field. It is because of the dollar sign ($50.00). [DataType(DataType.Currency)] [DisplayFormat(DataFormatString = "{0:c}", ApplyFormatInEditMode = true)] public decimal Amount { get; set; } @Html.EditorFor(model =...

0
Q: Design Pattern for Creating API URL

KetchupI am building a class library that interacts with various 3rd party API's. I have used an facade pattern to provide simplified access to complicated and confusing calls, and a factory pattern to return the correct implementation. I am now trying to build one of the implementation but cant think o...

 
:O
Ok so for example did you mean:
<input type="text" id="username[id]" name="username[id]"/>
 
Holy crap
 
Uh?
 
1:06 PM
You didn't see all those millions of ffeeds? xD
Ah, they're the initial Featured ones, that's ok :p
 
Oh yeah I did.. hence the ":O" lol
 
They won't show again phew
Okay so yes I did mean that
 
Mmn, that's cool but it wouldn't work with a ModelBinder?
Well what I'm asking isn't for forms only.. take this chat for example.
I can't edit your messages, but how is it implemented? How is each message identified?
By appending user and message id to the span element I think..
 
That last message was ID :7355662
When you hit up it cycles through messages with 1 textbox prob storing the 'CurrentlyEditingMessageId' in a hidden field or something
 
It would also need a user id
No?
 
1:10 PM
that could be stored in a global in the JS
currentUser = 2465742;
or whatever
 
Oh I could do that.. I guess I thought it was bad practice for some reason..
Hell screw bad practice... I don't have much time to submit this assignment.
Again, this is why I hate web dev..
 
The WebSockets are TCP based so the socket itself (prob server side) will maintain the user id
 
So websockets are used implicitly in mvc apps? I didn't know that.
 
No I meant specific to this chat
 
Ah right..
 
1:46 PM
I think this room is going to die at 5 pm European time.
 
10pm*
maybe even 11 or 12
 
I don't think the room counts as active while you and Mav are playing LoL.
This seems like pretty handy information if you're writing a SOAP API. msdn.microsoft.com/en-us/library/ms977327.aspx
 
If you check history for last night.... =P
 
2:21 PM
If I had a series of input:text with a class="inputs". $(".inputs").onkeypress(function(){})
 
no I don't think that will work
 
When that keypress event executes how would I identify which input the event was acted on? Surely this should be enough..
@Sean You mean the event won't bind? It appears to work
 
@LewsTherin Ok fair enough, I just thought that it won't work because you're going to get an array back
 
@Sean That's what I'm worried about..
mmn.. how would I identify the actual input?
The input elements are dynamic so I can't statically bind on the id
 
I think you should do something like.....
$(".inputs").each(function() {
    $(this).bind("onkeypress", function() {
        $(this).things();
    });
 });
you might be able to shortcut bind() to this: $(".inputs").bind() but I'm not sure
And yes, if you are keeping the function in that block, then this should work
 
2:29 PM
Looks reasonable, let's give that shot.. why use bind and not keypress directly?
 
Because I didn't know there was one there, replace it if you want
 
There was one what? :O
 
keypress() function
and also, even if you wanted a separate function you could use the handy event data stuff
 
Yeah that event variable would be handy
Hey Johan
 
hej, short brake from work, only home to walk the dogs
 
2:33 PM
$("#elem").each(function() { $(this).keypress(this, function(eventData) { $(eventData).things(); }); });
 
bind onkeypress doesn't seem to work.. but .keypress(function(evt)) works
@Sean Yeah, new problem.. how do I access this?
 
yeah I got the wrong name for it but couldn't edit the message
it should just be "keypress"
 
@JohanLarsson You live not far from home?
 
@LewsTherin two minutes walk
 
@Sean Yeah, so when the event handler executes... how do I access the element? I think there was something about self=this
@JohanLarsson Wow, handy much?
 
2:35 PM
@LewsTherin do you see how I got this? I passed it in as the eventData
@LewsTherin .keypress(this, function(eventData) { $(eventData).things(); });
in the function, eventData will be the element we passed in from the parent scope
 
@Sean Mmn.. I don't think this==eventData
 
@LewsTherin Yep
.keypress( [eventData ], handler(eventObject) )
 
mmmm this chicken is pure grease
 
@Sean Nope it isn't the element. It's a different object entirely..
 
To the extent of dripping :)
 
2:38 PM
I tried .attr('id') and I'm getting bollocks.
@RudiVisser Ah shurrup you ;) I'm hungry here..
 
@LewsTherin Oh sorry, you have to use eventData.data
 
Coming up null for some reason..
 
hnnnnngh
@LewsTherin Ok try amending it to .keypress({elem: this}, function(event) { $(event.data.elem).things(); });
 
The way seems to be init self = this and use self in the handler
@Sean data is null :(
 
2:41 PM
well use that then
 
I just poured coke over my fingers to get the grease off
 
Later Johan
 
Bye @JohanLarsson! You'll have a lot to catch up on in Skype tonight :p
 
@RudiVisser So fingers now sticky?
 
Nope significantly less so than before
 
2:42 PM
@LewsTherin If you've found a way and it works, use it, I'm just spewing stuff out from the docs =P
 
@Sean Let me try that.. I haven't seen that syntax before..
@Sean Didn't work ha.. so yeah will try your way again
 alert($(self).attr('id'));
 
does that work?
 
Yeah self is the element but it doesn't have an attr method apparently
 
I'm working from: api.jquery.com/bind and it's about half way down the page
I'm assuming .keypress works in the same way cos the signature is similar
 
Ah I'm looking at this: api.jquery.com/keypress
I will look at bind..
 
2:47 PM
yeah I have that one too
but the method signature is so similar I expect it to work in the same way
.bind( eventType [, eventData ], handler(eventObject) ) and .keypress( [eventData ], handler(eventObject) )
the only bit you're missing is the event type but I would have thought .keypress() is just a shortcut to .bind("keypress")
who knows
 
Their docs is confusing I can barely translate the signatures.
 
How is it confusing?
 
 .bind( eventType [, eventData ], handler(eventObject) )
What's with the subscript?
 
Optional arguments.
 
Oh right..
So basically .bind(eventType,..,handler(eventObject))?
 
2:51 PM
.bind('click', function(ev) {});
or
.bind('click', targetElement, function(ev) {});
The eventData can be used to do something. Whatever that something is.
 
@LewsTherin Did you just try $(this) inside the event handler? It may work, I dunno
 
@RoelvanUden Ah sweet..
 
Now you shouldn't have trouble understanding the documentation of any JS project :P
 
@Sean this would be on the current object.. I can get the value from $(self).value() so that seems to work.
But getting the id doesn't for some reason..
 
Oh in case you didn't know (or anyone), options is always just an object of stuff.
 
2:53 PM
@RoelvanUden It will take some time ;)
 
@LewsTherin jQuery is a PITA sometimes
 
@RoelvanUden options? As in optional arguments?
@Sean Damn straight :(
 
awesomeFunction(options, cb) can be seen as..

awesomeFunction({validate: false, upperCase: true, prefixWith: 'a'}, function(){});
If you encounter 'options' it usually allows you to set a bunch of values, like that.
 
That's cool.. didn't know that. Makes it easier to grok for some reason
 
@RoelvanUden I was trying to use the example from the bind page, about half way down where they send {msg: message} in and then access using event.data.msg (api.jquery.com/bind)
 
2:55 PM
What's the new way of creating DOM elements? Is it document.createElement or is there a new fancy way?
 
you create documentParts or something
can't remember what they're called
 
$(body).append('<div>Roel is awesome</div>');
If you need explicit access to each element, document.createElement.
 
For creating large tress and such, otherwise just use createElement
 
@Sean Ah that's how they use it here, so it's not used by an event per-se, but allows you do tell your event handler how something is used. That's sweet.
 
@RoelvanUden Yeah it would be if we could get it to work xD
 
2:58 PM
Thanks..
 
	function clickHandler(ev) {
		alert(ev.data.origin);
	}
	$('#button1').bind('click', {origin: 'Button 1'}, clickHandler);
	$('#button2').bind('click', {origin: 'Button 2'}, clickHandler);
I imagine it is like that.
 

« first day    last day (1778 days later) »