Kendo UI window not centering for you?

Thursday, March 28, 2013 0 comments


I recently had to build a new site and I wanted to use Kendo UI.  It's really good stuff and there are plenty of samples.  The thing about learning from samples is that sometimes the sample is incomplete.  Like this weird thing I noticed with the code I downloaded from https://github.com/telerik/kendo-music-store.  When you click an item in the ListView it opens detail in a Kendo Window.  Pretty cool, but it's not centered.  It puts the window at the bottom of the window for some reason.


Let's look at the code (/Scripts/App/store.js).


_openWindow = function (template, viewModel) {
            // Create a placeholder element.
            var window = $(document.createElement('div'));
 
            // Apply template to the placeholder element, and bind the viewmodel.
            var templateHtml = $(template).html();
            window.html(kendo.template(templateHtml)(viewModel));
            kendo.bind(window, viewModel);
 
            // Add window placeholder to the body.
            $('body').append(window);
 
            // Turn placeholder into a Window widget.
            window.kendoWindow({
                width: config.albumDetailsWindowWidth,
                title: viewModel.data.Title,
                resizable: false,
                close: function () {
                    // When the window is closed, remove the element from the document.
                    window.parents(".k-window").remove();
                }
            });
 
            // Center and show the Window.
            window.data("kendoWindow").center();
            window.data("kendoWindow").open();
        },

First, you can chain the center and open together.  Does this fix the centering issue? No.  But it's less code.

SQL Saturday #175 Fargo, ND April 27th

Friday, March 15, 2013 0 comments
SQL Saturday #175 Fargo, ND

When I heard SQL Saturday is coming to Fargo, ND on April 27th, 2013, I could't believe it. I was onsite at a client in Fargo when the news came out.  That was a sign, I must submit a session.  Fargo is growing rapidly, heck the whole state of North Dakota is.  Fargo getting a SQL Saturday is not surprising with the oil boom and the growth of the internet and the new technology in agriculture.  North Dakota has more data than ever.  Good thing I like data.

The title of my session is "A Complete BI Solution in About an Hour!"  I really appreciate the whole Microsoft SQL stack and how you can, with one install and some quick setup, really get a problem solved in no time at all.  I'll be re-working my slide deck a bit from previous events and have new code to show.  I might even throw in some nice HTML5, CSS, and JavaScript wiz bang to end the show.

As of right now, I'm on at 10 am in room 1. SCHEDULE HERE That's a really good time for me.  My session is the only beginner level talk in that 10am slot so I hope there will be enough beginners that want to hear about BI.  If I don't fill the room, I can take more questions and show all the other ways that Microsoft makes BI easy for us SQL developers to get the job done.  

See you in April! I hear there are a lot of registrations.  I'm not surprised it's only $10 for a full day of SQL goodness.
 
 

JavaScript should be your favorite language

Thursday, March 14, 2013 0 comments
So you think you're really cool because you're hardcore and know everything there is about PHP or C# or C++ or VB or Perl or Ruby or Python or ColdFusion or Java or ActionScript or..  I should stop right?  The thing is, as developers we've been coding in all these other languages to fit the phone, desktop, server and platform we think is best.  But we were wrong.  There is no "best" or "favorite" platform.  We shouldn't have been writing Flash apps.  We shouldn't have been writing Silverlight or Windows or Mono or XNA or Java apps.  We should have been writing HTML5 apps this whole time. 

Don't get me wrong.  I don't thing that the debate of standards based apps vs native apps is over.  I think it's going to go nuclear.  Soon their will be iOS, Windows, Ubuntu, Chrome, Android, Blackberry, Firefox OS, and more to come.  They (I assume) will all probably be a little different but there will be ways to write in just HTML5, JavaScript and CSS.

So if you are really cool and prefer all those other languages, maybe you should look at JavaScript a little closer like I have this past year.  Dive deep, don't just use it when you really have to.  Try out some server side stuff like Node.js.  Or, God forbid, write a Windows Store App in JavaScript instead of C#.  You might like it.  I do.

Brackets for Good

Monday, March 11, 2013 0 comments
Brackets for Good

This story actually starts for me back in 2010.  I volunteered for Indy GiveCamp.  My assignment was to help organize and lead a team to upgrade a community center's website to DotNetNuke.  That's when I was pulled in to help the Trusted Mentors team build a database application.  GiveCamps are really cool.  You get to code for charity, if you have the chance go volunteer.

Things circled back around in 2011 when I was developing some really cool medical device software at WoundVision.  We were doing really well at the time.  We had offices near Fountain Square where Trusted Mentors has it's office.  We got to sponsor a breakfast at the Fieldhouse event for them.  It happened to be my birthday, it was a really cool event and a great birthday present from WoundVision.  I miss all those poeple, we made some really good software together.

Now it's time for me to pay back so I've given a few bucks, that's all it takes. It's a really cool idea for March.  All non-profits benefit and there is a bonus at the end for the winning team.  Please help by going out to the Brackets for Good site and buying some points for your favorite team.  Perhaps that is even my favorite team, Trusted Mentors.


Poplulist vs Elitist

Wednesday, March 6, 2013 0 comments
I first need to tell you that is not a political blog. I don't have any agenda and seldom post anything too controversial. If you are looking for that sort of thing you'll not find it here. This post is about styles, techniques, or preferences in developing software.

I'm not an Elitist, at least I don't think I am. I'm very open minded and try not to force my views of engineering on anyone. I have been a team lead many times in the past though. I'm made decisions and dictated standards that might seem high and mighty. A lot of where I come from is Pragmatism. I don't like really over engineered 9 tier application frameworks. When I step through the debugger and hit the F10 key 50 times, I have a heart attack. Why all the nesting?

I'm not a Populist either. I don't necessarily think Ruby on Rails is the definition of MVC, even though most developers who do MVC use Rails. ASP.NET MVC is cool, as are others. I don't think that the iPhone and iPad are the best devices ever. I actually think they are a pain to use and too plain for me. I don't think that everyone should code the same way. Go4 can kiss my... I could really care less about how your css is minified as long as it works and doesn't take forever to download.

So why am I writing this blog post? I really don't like spaghetti code. I'm ok with 70% code coverage in NCover. If my app only has 3 layers, I'm ok with it. If I have to write a stored procedure to get what I want out of the database, cool. I can code from the UI in, or the schema out. What I don't like is over engineered bloat! I don't get along with Elitist software guys who care about REST vs RESTful.

My apps aren't for everyone and I didn't take a long time to code them. They are there for the users who like using them. My project plan was only 6 months long. We released on time, and hopefully we made money. My code doesn't have a lot of dependencies and is pretty simple, really fast. I'm not going to be an Elistist and tell you to follow my lead. But if my way becomes popular, I'm ok with that.

 
Copyright © Aaron Stanley King