Wednesday, July 30, 2014

Support to google in english to sinhala translation

Google needs your support.Contribute to google in translating phrases/words to sinhala language.

http://translate.google.com/community

Regards
Samitha

Tuesday, July 29, 2014

JSON not Defined (IE 9)

When using JSON , IE 9 browser seem to behave bit strangely.  When I dig in to the issue i found that its because documents should be rendered in standards mode, as showing in the following code snippet.



...

Read more about document compatibility here.

Regards
Samitha

Sunday, July 13, 2014

Miscrosoft Exams online practice questions

Following web site offers online practice exams for some of the current Microsoft exams ( exams for Java, CPA hopefully will be added in the near future).

Available Microsoft exams includes
70-480, 70-482,70-483,70-484,70-485, 70-486, 70-331,70-332...

http://axiommanifold.com/#/

Cheers
Samitha

Thursday, June 26, 2014

jquery not working after postback

It seems that after a partial postback occured from an update panel jquery events does not work as expected. This can be solved by usin pageLoad() instead of $(document).ready() as shown in the following link http://encosia.com/2009/03/25/document-ready-and-pageload-are-not-the-same/

Cheers
Samitha

Monday, June 9, 2014

format Jquery autocomplete result set

If you want to customize the appearance of the jQuery autocomplete suggestion result set, you have to replace the _renderItem function with your own creation that produces the desired result. The function definition will be as follows.

 $(function () {

 $.ui.autocomplete.prototype._renderItem = function (ul, item) {
            item.label = item.label.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(this.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1");
            return $("
  • ")
                        .data("item.autocomplete", item)
                        .append("" + item.label + "")
                        .appendTo(ul);
            };

    //attach your autocomplete to the textbox. See my previous post http://ssenarath.blogspot.com/2014/06/jquery-autocomplete-suggest-size-is.html
    $("#ContentPlaceHolder1_txtDesignation").autocomplete({
     ...
    });

    });

    A complete discussion of similar topic can be found in http://stackoverflow.com/questions/2435964/jqueryui-how-can-i-custom-format-the-autocomplete-plug-in-results

    Cheers
    Samittha

    Thursday, June 5, 2014

    Jquery Autocomplete suggest size is displayed larger than the textbox

    When you use Jquery to make an autocomplete, IE displays the width of the suggest window lager than the input box.To make the suggestion window smaller you can apply code as shown below.

     $(function () {

     $("#txtSearch").autocomplete({
                source: function (request, response) {
                    $.ajax({

                        contentType: "application/json; charset=utf-8",
                        dataType: 'JSON',
                        url: '../SearchEmployee.asmx/GetEmployeeSuggestionList',
                        type: "POST",
                        data: '{empCode: "' + request.term + '"}',
                        dataType: "json",

                        success: function (data) {
                            response($.map(data.d, function (item) {
                                return {
                                    label: item,
                                    value: item
                                }
                            }))
                        }
                    });

                }            minLength: 1,
                open: function(event, ui)
                {
                    $("#ctl00_cphMobileMainContent_txtSearch").autocomplete("widget").css("width", "300px"); 
                }       
     });
    });

    cheers
    Samitha

    Tuesday, May 13, 2014

    SQL Server Debugging with WinDbg

    Debugging in Server is a on of the concerns for modern developers. The following articles reveal information about a tool that can be used in SQL Server Debugging and what are the reasons for choosing it.

    http://www.sqlservercentral.com/blogs/aschenbrenner/2014/05/05/sql-server-debugging-with-windbg-an-introduction/

    Cheers
    Samitha