Showing posts with label JS. Show all posts
Showing posts with label JS. Show all posts

Sunday, 16 November 2014

Expand and collapse link for an Div in vf page using Jquery.

Hi Friends,

This is a small but useful post to maintain UI of your Visualforce page,

to add show more link(for expand) and show less link(for collapse) on div (or any other HTML tag) when div height is more then expected size.

Look at the screen shot below:-


So to solve this issue you can use the following java script and jquery:-


Screen Shots:-



Hope this helps..

Thanks
Anurag Jain

Wednesday, 7 May 2014

Insert Records in SF by using JavaScript without Apex classes or controller.





Hi guys,

In this post i am showing how can we use the power of javascript in VF page and inserting record in salesforce without any standard/custom controller or Apex.

By using AJAX Toolkit we can do this task easily.

AJAX Toolkit divides in two type synchronous and asynchronous call.

It works in three simple steps:
  1. Connecting to the AJAX Toolkit(By using login methods or getting Session_ID)
  2. Embedding the API methods in JavaScript.
  3. Processing the results.
in following example i am using synchronous call :-


Screen Shoots:-


 After inserting of record you are having ID of record :-


Happy Coding...:)

Thanks
Anurag Jain

Friday, 17 January 2014

Use Tab Color Dynamically on VF page from JS.





Hi guys,

I am writing this post because recently i used it and feel must share it,

Here I am creating a VF with some colored arrow on page (Created by using CSS) and color of arrows automatically changes according to the color and style of the Custom-Tab,

This requirement is mainly needed when you are creating a detail VF page

Now magic is to use arrow color same as the Tab color of your object.

I achieved this using Javascript and CSS,

Here is the VF page code:-


Screen Shots:


Now, i just changed Tab Style and color by following these steps:-

Setup -> Create -> Tabs -> Custom_Object__c

Here is the new Tab style and color:-


arrows and highlighted section color changes automatically.


Hope it will help u guys, Happy Coding....:)