Showing posts with label web development. Show all posts
Showing posts with label web development. Show all posts

Friday, March 6, 2015

How to change the Date Format of an inline DatePicker in jQuery Editable DataTables

I've been working on a .Net MVC project that uses an older version of jQuery Datatables. The work involved upgrading a datatable to be editable. Using this CodeProject article I successfully upgraded the DataTable with DataTables Editable.

DataTables editable allows for non-standard inline input types, one of which is a datepicker, described here, which uses jeditable-datepicker. One problem I faced was setting the format of the datepicker to EU format dd/mm/yy rather than the default US format mm/dd/yy.

After exhausting lots of methods of conversion both client side and server side, I finally stumbled upon the github page for jeditable-datpicker which lists format as one of the usage options. A simple option yes, but lack of detailed documentation for DataTables Editable caused me to go searching and experimenting for longer than I should have needed to. Hopefully this post will save someone else that time :-)

For posterity, the code below shows how to set the format option of a datepicker in an editable datatable:


...
"aoColumns": [
{  type:   'datepicker',
    sSuccessResponse: "IGNORE",
    datepicker: {
        dateFormat: 'dd/mm/yy'
    }
},
]
...


SOURCE LINKS:

CodeProject - ASP.NET MVC Editable Table (jQuery DataTables and ASP.NET MVC integration - Part II)

jQuery DataTables Usage Reference

GitHub - jEditable Datepicker

Wednesday, March 20, 2013

Drupal Twitter Module Error Message: Could not obtain a valid token from the Twitter API. Please review the configuration.

I recently encountered this message while trying to use the Drupal Twitter Module to access a twitter application:

Could not obtain a valid token from the Twitter API. Please review the configuration.

CAUSE

The message was caused by the Callback field in the twitter application setup not being filled in.

SOLUTION

Enter the following in the Callback field

http://127.0.0.1:8000/twitter/oauth

SOURCE:
Twitter 7.x Module Installation (http://drupal.org/node/1346824)


Wednesday, August 8, 2012

Links in Dropdown CSS menu not working in FireFox 14.01

I came across an obscure css sequencing problem today which occurred after an update to Firefox 14.01.

PROBLEM:

A css dropdown menu that uses focus and hover to show/hide submenu links stopped working in Firefox 14.01. The dropdown menu appears, but clicking on the link causes the menu to freeze and the user cannot navigate to the link by clicking on it.


SOLUTION

The CSS code hides each submenu by setting the margin-left to -9999px, and shows it on hover by setting the margin-left to 0px; The cascading rules for this operation were as follows:


#nav ul,
#nav :hover ul ul,
#nav .hover ul ul { margin-left: -9999px; }
#nav li:hover>ul,
#nav li.hover>ul,
#nav a:focus+ul,
#nav ul ul,
#nav .hover a:focus a:active { margin-left: 0; }
#nav ul a:focus { margin-left: 9999px; }


It appears however that a change in the sequence the CSS is parse/run in Firefox 14.01 caused the last line to take effect after the link is clicked but before the browser evalutes the link and navigates to the page causing the element to move away before the click takes effect, perhaps because the sequence is hover->focus->active when clicking on a link.

To fix, I replaced the last line with:

#nav ul a:focus { margin-left: 0px; }

which stops the element from moving so that the click can be registered in Firefox 14.01.





Wednesday, November 23, 2011

Drupal DDBlock Error: [cycle] terminating; too few slides

When trying to configure the DDBlock module in Drupal 7, the following javascript error appeared:

[cycle] terminating; too few slides

CAUSE:
The jquery.cycle code cannot detect image slides because the Content Container name is set incorrectly in the configuration settings of the block.

SOLUTION
Edit the block configuration and use the suggested value for Content Container:

div.slide

Sunday, November 13, 2011

How To Be A One Person Startup

There is an excellent article about the struggles encountered when thinking about building a one-person startup. The article covers myths such as:


  • Enough time
  • A good idea
  • Money
  • Lack of marketing/sales
  • I can't quit my job


SOURCE:
http://www.intermittentintelligence.com/youre-a-developer-so-why-do-you-work-for-some

Tuesday, November 8, 2011

Extending EditPlus with PHP IDE Functionality

An excellent article detailing how to add PHP syntax checking, context sensitive PHP help commands, and google searching to Editplus for PHP development.
The most useful in my view is the Syntax Checker, which can be added as a user tool in Tools -> Configure User Tools-> Add Tool >> Program, and enter:

Menu text   : PHP syntax checker
Command     : c:\php\php.exe -l
Argument    : $(FileName)

You can then map it to a keyboard shortcut using the Keyboard subtree option on the left. I have found SHIFT-S and very handy companion to CTRL-S for saving and verifying your PHP file.

SOURCE
http://www.base64.co.uk/extend-editplus-php-ide/

Saturday, October 15, 2011

Google Wave & The Mythical Man-Month

Even Google can struggle with large team complexity and disparate spread of knowledge, as evidenced by this Dhanji R. Prasanna's blog post about his time on the Google Wave Team.


SOURCE:
http://rethrick.com/#mmm


Wednesday, July 27, 2011

Interesting predictions about the tech industry

Tech industry predictions from Roger McNamee, incl the future of Google, Facebook, Microsoft etc.
HTML5 is the silver bullet apparently...