locked
How to use JQuery in CRM 4.0 ? RRS feed

  • Question

  • Hi,

    Can any one tell me how to use JQuery in CRM 4.0, can any one send the samples or tutorials of how to use jquery in CRM 4.0.
    Any suggestions are welcome.

    Thanks,
    Rajesh Kumar. 
    Friday, February 5, 2010 7:46 AM

Answers

All replies

  • Friday, February 5, 2010 7:50 AM
  • Way for me bump up a post from almost 2 years ago!

    I'm having the same issue here at work. We haven't yet upgraded to CRM 2011, and I'd like to start using jQuery to make our lives a bit easier with JavaScript development. There's a ton of things I want to take advantage of, such as custom functions and chaining. For instance, I would love to do something like:

    (function ($) {
    
    $.fn.disabled = function () { $(this).Disabled = true; return $(this); }
    
    $.fn.enabled = function () { $(this).Disabled = false; return $(this); }
    
    $.fn.forceSubmit = function () { $(this).ForceSubmit = true; return $(this); }
    
    $.fn.dataValue = function (value) { $(this).DataValue = value; return $(this); }
    
    })(jQuery);
    
    
    
    crmForm.all.someelement.dataValue("").disabled().forceSubmit();
    
    
    
    


    To cut down the three lines it currently takes up:

    crmForm.all.someelement.DataValue = null;
    
    crmForm.all.someelement.Disabled = true;
    
    crmForm.all.someelement.ForceSubmit = true;

    However, I am having one heck of an issue using crmForm as a variable, or even using #someelement as a jQuery selector. For one, the text input boxes for Date values don't have their ID set to #someelement they are set to DateValue.

    Does anyone have some help for me in this area? My team and I are itching to get into jQuery to help speed our Javascript development time up, but I'm not seeing much of an advantage of it if we can't use crmForm elements with jQuery considering many of our enhancements deal with custom logic, not style.

     


    Wednesday, September 28, 2011 3:03 PM