This topic is locked
[SOLVED]

 My persian calendar plugin

4/29/2015 3:26:44 AM
PHPRunner General questions
A
alimoshtaghi@gmail.com author

hi

i have made my own persian calendar plugin.

it works but after it loaded on add or edit form "save" and other buttons doesnot work.
Myplugin name is jalalidate
content of EditJalaliDate.php
<?php

class EditJalaliDate extends UserControl

{

function initUserControl()

{

}
function buildUserControl($value, $mode, $fieldNum = 0, $validate, $additionalCtrlParams, $data)

{

echo $this->getSetting("label").'<input type="text" id="datepicker3" >';

}
function getUserSearchOptions()

{

return array(EQUALS, STARTS_WITH, NOT_EMPTY, NOT_EQUALS);

}
/**

  • addJSFiles
  • Add control JS files to page object

    */
    function addJSFiles()

    {

    $this->pageObject->AddJSFile("scripts/jquery-1.6.2.min.js");

    $this->pageObject->AddJSFile("scripts/jquery.ui.core.js");

    $this->pageObject->AddJSFile("scripts/jquery.ui.datepicker-cc.js");

    $this->pageObject->AddJSFile("scripts/calendar.js");

    $this->pageObject->AddJSFile("scripts/jquery.ui.datepicker-cc-ar.js");

    $this->pageObject->AddJSFile("scripts/jquery.ui.datepicker-cc-fa.js");

    $this->pageObject->AddJSFile("scripts/main.js");
    }
    /**
  • addCSSFiles
  • Add control CSS files to page object

    */

    function addCSSFiles()

    {

    $this->pageObject->AddCSSFile("styles/jquery-ui-1.8.14.css");

    }

    }

    ?>
    content of js file:
    Runner.controls.EditJalaliDate = Runner.extend(Runner.controls.Control,{

    /**
  • Override constructor
  • @param {Object} cfg

    */

    myVal: "value of my Field: ",

    constructor: function(cfg){

    this.addEvent(["change", "keyup"]);

    // call parent

    Runner.controls.EditJalaliDate.superclass.constructor.call(this, cfg);

    this.myVal = this.getFieldSetting("myVal");

    $("#"+this.valContId).miniColors({

    letterCase: 'uppercase'

    });
    },

    /**
  • Clone html for iframe submit
  • @return {array}

    */

    getForSubmit: function(){

    if (!this.appearOnPage()){

    return [];

    }

    return [this.valueElem.clone().val(this.getValue())]

    },

    setFocus: function(){

    if (!this.appearOnPage()){

    return [];

    }

    return false;

    }
    });
    Runner.controls.constants["EditJalaliDate"] = "EditJalaliDate";