本文整理汇总了PHP中QButton类的典型用法代码示例。如果您正苦于以下问题:PHP QButton类的具体用法?PHP QButton怎么用?PHP QButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QButton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($objParentObject, $strControlId = null, StewardshipBatch $objBatch, StewardshipStack $objStack = null, $strUrlHashArgument1 = null, $strUrlHashArgument2 = null, $strUrlHashArgument3 = null)
{
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->strTemplate = dirname(__FILE__) . '/' . get_class($this) . '.tpl.php';
$this->objBatch = $objBatch;
$this->objStack = $objStack;
$this->strUrlHashArgument = $strUrlHashArgument1;
$this->strUrlHashArgument2 = $strUrlHashArgument2;
$this->strUrlHashArgument3 = $strUrlHashArgument3;
$this->btnSave = new QButton($this);
$this->btnSave->Text = 'Save';
$this->btnSave->CssClass = 'primary';
$this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
$this->btnSave->CausesValidation = $this;
$this->btnCancel = new QLinkButton($this);
$this->btnCancel->Text = 'Cancel';
$this->btnCancel->CssClass = 'cancel';
$this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
$this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
$this->SetupPanel();
}
开发者ID:alcf,项目名称:chms,代码行数:26,代码来源:CpStewardship_Base.class.php
示例2: dtg_ButtonRender
public function dtg_ButtonRender($item)
{
$strControl = new QButton($this);
$strControl->Text = 'Button';
$strControl->ActionParameter = $item;
$strControl->AddAction(new QClickEvent(), new QServerAction('btn_click'));
return $strControl->Render(false);
}
开发者ID:vaibhav-kaushal,项目名称:qc-framework,代码行数:8,代码来源:ui_url.php
示例3: dtgNotificationUserAccount_EditLinkColumn_Render
public function dtgNotificationUserAccount_EditLinkColumn_Render(NotificationUserAccount $objNotificationUserAccount)
{
$strControlId = 'btnEdit' . $this->dtgNotificationUserAccount->CurrentRowIndex;
$btnEdit = $this->objForm->GetControl($strControlId);
if (!$btnEdit) {
$btnEdit = new QButton($this->dtgNotificationUserAccount, $strControlId);
$btnEdit->Text = QApplication::Translate('Edit');
$btnEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnEdit_Click'));
}
$btnEdit->ActionParameter = $objNotificationUserAccount->NotificationUserAccountId;
return $btnEdit->Render(false);
}
开发者ID:heshuai64,项目名称:einv2,代码行数:12,代码来源:NotificationUserAccountListPanelBase.class.php
示例4: dtgDatagrid_EditLinkColumn_Render
public function dtgDatagrid_EditLinkColumn_Render(Datagrid $objDatagrid)
{
$strControlId = 'btnEdit' . $this->dtgDatagrid->CurrentRowIndex;
$btnEdit = $this->objForm->GetControl($strControlId);
if (!$btnEdit) {
$btnEdit = new QButton($this->dtgDatagrid, $strControlId);
$btnEdit->Text = QApplication::Translate('Edit');
$btnEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnEdit_Click'));
}
$btnEdit->ActionParameter = $objDatagrid->DatagridId;
return $btnEdit->Render(false);
}
开发者ID:heshuai64,项目名称:einv2,代码行数:12,代码来源:DatagridListPanelBase.class.php
示例5: renderButton
public function renderButton(Person $objPerson)
{
$objControlId = "editButton" . $objPerson->Id;
if (!($objControl = $this->GetControl($objControlId))) {
$objControl = new QButton($this, $objControlId);
$objControl->Text = "Edit Person #" . $objPerson->Id;
$objControl->AddAction(new QClickEvent(), new QAjaxAction("renderButton_Click"));
$objControl->ActionParameter = $objPerson->Id;
}
// We pass the parameter of "false" to make sure the control doesn't render
// itself RIGHT HERE - that it instead returns its string rendering result.
return $objControl->Render(false);
}
开发者ID:eliud254,项目名称:q-auction,代码行数:13,代码来源:links_images.php
示例6: RenderDeleteButton
/**
* A non-delegated event version. Create a new button for each control and attach an action to it.
*
* @param Person $objPerson
* @return String
*/
public function RenderDeleteButton($objPerson)
{
$strControlId = 'btn' . $objPerson->Id;
$objControl = $this->GetControl($strControlId);
if (!$objControl) {
$objControl = new QButton($this);
$objControl->Text = 'Edit';
$objControl->ActionParameter = $objPerson->Id;
$objControl->AddAction(new QClickEvent(), new QAjaxAction('dtgPersonsButton_Click'));
// This will generate a javascript call for every button created.
}
return $objControl->Render(false);
}
开发者ID:vaibhav-kaushal,项目名称:qc-framework,代码行数:19,代码来源:event_delegation.php
示例7: lnkSelected_Render
public function lnkSelected_Render(Praises $objPraise)
{
$strControlId = 'lnkSelected' . $objPraise->Id;
// Let's see if the Checkbox exists already
$lnkSelected = $this->GetControl($strControlId);
if (!$lnkSelected) {
$lnkSelected = new QButton($this->dtgPraises, $strControlId);
$lnkSelected->Text = $objPraise->Subject;
$lnkSelected->ActionParameter = $objPraise->Id;
$lnkSelected->CssClass = 'linkButton';
$lnkSelected->AddAction(new QClickEvent(), new QServerAction('lnkSelected_Click'));
}
return $lnkSelected->Render(false);
}
开发者ID:alcf,项目名称:chms,代码行数:14,代码来源:view_praises.php
示例8: render_btnToggleRecords
public function render_btnToggleRecords($parControl, $strType)
{
$strControlId = 'btnToggleRecordsforaddressofperson' . $strType->Id . 'ofproject' . $this->objProject->Id;
if (!($objControl = $parControl->GetChildControl($strControlId))) {
// But in this case the parent control of the button
// would be this child QDataGrid, don't forget that...
$person_addresses = Address::QueryCount(QQ::Equal(QQN::Address()->PersonId, $strType->Id));
if ($person_addresses > 0) {
$objControl = new QButton($parControl, $strControlId);
$objControl->Width = 20;
$objControl->Text = '+';
$objControl->CssClass = 'inputbutton';
$objControl->ActionParameter = "{$strType->Id}";
// Important! for a better coding we want to all
// actions referer to the child QdataGris stay
// in the child Qdatagrid, so the actions are now
// QAjaxControlAction or QServerControlAction, were the
// controlId parameter is $this, becaouse in $this class
// is defined the event for this button... kind of easy,
// and clean.
$objControl->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnToggleRecords_Click', $this->objParentObject->WaitIcon));
} else {
// No addresses to expand; we'll use an empty label control to signify that
$objControl = new QLabel($parControl, $strControlId);
$objControl->Text = '';
}
}
// We pass the parameter of "false" to make sure the control doesn't render
// itself RIGHT HERE - that it instead returns its string rendering result.
return $objControl->Render(false);
}
开发者ID:hiptc,项目名称:dle2wordpress,代码行数:31,代码来源:records.summary.php
示例9: Form_Create
protected function Form_Create()
{
// default legacy protection, will throw an exception
$this->txtTextbox1 = new QTextbox($this);
$this->txtTextbox1->Text = 'Hello!';
$this->txtTextbox1->Width = 500;
$this->lblLabel1 = new QLabel($this);
$this->lblLabel1->HtmlEntities = false;
$this->lblLabel1->Text = "";
$this->btnButton1 = new QButton($this);
$this->btnButton1->Text = "Parse and Display";
$this->btnButton1->AddAction(new QClickEvent(), new QAjaxAction('btnButton1_Click'));
// htmlentities mode
$this->txtTextbox2 = new QTextbox($this);
$this->txtTextbox2->CrossScripting = QCrossScripting::HtmlEntities;
$this->txtTextbox2->Text = 'Hello! <script>alert("I am an evil attacker.")</script>';
$this->txtTextbox2->Width = 500;
$this->lblLabel2 = new QLabel($this);
$this->lblLabel2->Text = "";
$this->btnButton2 = new QButton($this);
$this->btnButton2->Text = "Parse and Display";
$this->btnButton2->AddAction(new QClickEvent(), new QAjaxAction('btnButton2_Click'));
// full protection with the HTMLPurifier defaults
$this->txtTextbox3 = new QTextbox($this);
$this->txtTextbox3->CrossScripting = QCrossScripting::HTMLPurifier;
$this->txtTextbox3->Text = 'Hello! <script>alert("I am an evil attacker.")</script>';
$this->txtTextbox3->Width = 500;
$this->lblLabel3 = new QLabel($this);
$this->lblLabel3->Text = "";
$this->btnButton3 = new QButton($this);
$this->btnButton3->Text = "Parse and Display";
$this->btnButton3->AddAction(new QClickEvent(), new QAjaxAction('btnButton3_Click'));
// full protection with an allowed list of tags
$this->txtTextbox4 = new QTextbox($this);
$this->txtTextbox4->CrossScripting = QCrossScripting::HTMLPurifier;
$this->txtTextbox4->SetPurifierConfig("HTML.Allowed", "b,strong,i,em,img[src]");
$this->txtTextbox4->Text = 'Hello! <script>alert("I am an evil attacker.")</script><b>Hello</b> <i>again</i>!';
$this->txtTextbox4->Width = 500;
$this->lblLabel4 = new QLabel($this);
$this->lblLabel4->HtmlEntities = false;
$this->lblLabel4->Text = "";
$this->btnButton4 = new QButton($this);
$this->btnButton4->Text = "Parse and Display";
$this->btnButton4->AddAction(new QClickEvent(), new QAjaxAction('btnButton4_Click'));
// the textbox won't have the XSS protection!
$this->txtTextbox5 = new QTextbox($this);
$this->txtTextbox5->CrossScripting = QCrossScripting::Allow;
$this->txtTextbox5->Text = 'Hello! <script>alert("I am an evil attacker.")</script><b>Hello</b> again!';
$this->txtTextbox5->Width = 500;
$this->lblLabel5 = new QLabel($this);
$this->lblLabel5->HtmlEntities = false;
$this->lblLabel5->Text = "";
$this->btnButton5 = new QButton($this);
$this->btnButton5->Text = "Parse and Display";
$this->btnButton5->AddAction(new QClickEvent(), new QAjaxAction('btnButton5_Click'));
}
开发者ID:tomVertuoz,项目名称:framework,代码行数:56,代码来源:xss.php
示例10: EditColumn_Render
public function EditColumn_Render(Attribute $objAttribute)
{
// Let's specify a specific Control ID for our button, using the datagrid's CurrentRowIndex
$strControlId = 'btnEditAttribute' . $this->dtgAttributes->CurrentRowIndex;
$btnEdit = $this->objForm->GetControl($strControlId);
if (!$btnEdit) {
// Only create/instantiate a new Edit button for this Row if it doesn't yet exist
$btnEdit = new QButton($this->dtgAttributes, $strControlId);
$btnEdit->Text = 'Add';
$btnEdit->CssClass = 'primary';
// Define an Event Handler on the Button
// Because the event handler, itself, is defined in the control, we use QAjaxControlAction instead of QAjaxAction
$btnEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnEditAttribute_Click'));
}
// Finally, update the Actionparameter for our button to store the $objAttribute's ID.
$btnEdit->ActionParameter = $objAttribute->Id . "_" . $objAttribute->AttributeDataTypeId . "_" . $objAttribute->Name . "_" . $this->dtgAttributes->CurrentRowIndex;
// Return the Rendered Button Control
return $btnEdit->Render(false);
}
开发者ID:alcf,项目名称:chms,代码行数:19,代码来源:Vicp_Attributes_Add.class.php
示例11: __construct
public function __construct($objParentObject, $strControlId = null, Person $objPerson = null, $strUrlHashArgument)
{
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->strTemplate = dirname(__FILE__) . '/../' . $this->objForm->strSubNavItemArray[$this->objForm->strSubNavItemToken][1] . '/' . get_class($this) . '.tpl.php';
$this->objPerson = $objPerson;
$this->strUrlHashArgument = $strUrlHashArgument;
$this->btnSave = new QButton($this);
$this->btnSave->Text = 'Save';
$this->btnSave->CssClass = 'primary';
$this->btnSave->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSave_Click'));
$this->btnSave->CausesValidation = $this;
$this->btnCancel = new QLinkButton($this);
$this->btnCancel->Text = 'Cancel';
$this->btnCancel->CssClass = 'cancel';
$this->btnCancel->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnCancel_Click'));
$this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
$this->SetupPanel();
}
开发者ID:alcf,项目名称:chms,代码行数:23,代码来源:Vicp_Base.class.php
示例12: render_btnToggleRecordsSummary
public function render_btnToggleRecordsSummary(Project $objProject)
{
// Create their unique id...
$objControlId = 'btnToggleRecordsSummary' . $objProject->Id;
if (!($objControl = $this->GetControl($objControlId))) {
$intTeamMemberCount = Person::CountByProjectAsTeamMember($objProject->Id);
if ($intTeamMemberCount > 0) {
// If not exists create our toggle button who his parent
// is our master QDataGrid...
$objControl = new QButton($this->dtgProjects, $objControlId);
$objControl->Width = 25;
$objControl->Text = '+' . $intTeamMemberCount;
$objControl->CssClass = 'inputbutton';
// Pass the id of the bounded item just for other process
// on click event
$objControl->ActionParameter = $objProject->Id;
// Add event on click the toogle button
$objControl->AddAction(new QClickEvent(), new QAjaxAction('btnToggleRecordsSummary_Click'));
}
}
// We pass the parameter of "false" to make sure the control doesn't render
// itself RIGHT HERE - that it instead returns its string rendering result.
return $objControl->Render(false);
}
开发者ID:vaibhav-kaushal,项目名称:qc-framework,代码行数:24,代码来源:project_list.php
示例13: SetupEmailMessageControls
/**
* Sets up the EmailMessageRouteDataGrid if there are messages associated with this group
* @return void
*/
protected function SetupEmailMessageControls()
{
$this->dtgEmailMessageRoute = new EmailMessageRouteDataGrid($this);
$this->dtgEmailMessageRoute->MetaAddColumn(QQN::EmailMessageRoute()->EmailMessage->DateReceived, 'Width=115px', 'FontSize=11px', 'Html=<?= $_CONTROL->ParentControl->RenderEmailDateReceived($_ITEM); ?>');
$this->dtgEmailMessageRoute->MetaAddColumn(QQN::EmailMessageRoute()->EmailMessage->FromAddress, 'Width=200px', 'FontSize=11px', 'Html=<?= $_CONTROL->ParentControl->RenderEmailFromAddress($_ITEM); ?>', 'HtmlEntities=false');
$this->dtgEmailMessageRoute->MetaAddColumn(QQN::EmailMessageRoute()->EmailMessage->Subject, 'Width=420px', 'FontSize=11px', 'Html=<?= $_CONTROL->ParentControl->RenderEmailSubject($_ITEM); ?>', 'HtmlEntities=false');
$this->dtgEmailMessageRoute->SetDataBinder('dtgEmailMessageRoute_Bind', $this);
$this->dtgEmailMessageRoute->Paginator = new QPaginator($this->dtgEmailMessageRoute);
$this->dtgEmailMessageRoute->SortColumnIndex = 0;
$this->dtgEmailMessageRoute->SortDirection = 1;
$this->dlgEmailMessage = new QDialogBox($this);
$this->dlgEmailMessage->Template = dirname(__FILE__) . '/dlgEmailMessage.tpl.php';
$this->dlgEmailMessage->HideDialogBox();
$this->btnEmailMessage = new QButton($this->dlgEmailMessage);
$this->btnEmailMessage->Text = 'Close';
$this->btnEmailMessage->AddAction(new QClickEvent(), new QHideDialogBox($this->dlgEmailMessage));
$this->pxyEmailMessage = new QControlProxy($this);
$this->pxyEmailMessage->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxyEmailMessage_Click'));
$this->pxyEmailMessage->AddAction(new QClickEvent(), new QTerminateAction());
}
开发者ID:alcf,项目名称:chms,代码行数:24,代码来源:CpGroup_Base.class.php
示例14: btnAddField_Click
protected function btnAddField_Click()
{
$intTotalCount = count($this->lstMapHeaderArray);
$this->lstMapHeader_Create($this, $intTotalCount - 1, $this->chkHeaderRow->Checked ? "addfield" : null);
$objTemp = $this->lstMapHeaderArray[$intTotalCount];
$this->lstMapHeaderArray[$intTotalCount] = $this->lstMapHeaderArray[$intTotalCount - 1];
$this->lstMapHeaderArray[$intTotalCount - 1] = $objTemp;
$txtDefaultValue = new QTextBox($this);
$txtDefaultValue->Width = 200;
$this->txtMapDefaultValueArray[] = $txtDefaultValue;
$lstDefaultValue = new QListBox($this);
$lstDefaultValue->Width = 200;
$lstDefaultValue->Display = false;
$this->lstMapDefaultValueArray[] = $lstDefaultValue;
$dtpDate = new QDateTimePicker($this);
$dtpDate->DateTimePickerType = QDateTimePickerType::Date;
$dtpDate->DateTimePickerFormat = QDateTimePickerFormat::MonthDayYear;
$dtpDate->Display = false;
$this->dtpDateArray[] = $dtpDate;
$btnRemove = new QButton($this);
$btnRemove->Text = "Remove";
$btnRemove->ActionParameter = $intTotalCount - 1;
$btnRemove->AddAction(new QClickEvent(), new QServerAction('btnRemove_Click'));
$btnRemove->AddAction(new QEnterKeyEvent(), new QServerAction('btnRemove_Click'));
$btnRemove->AddAction(new QEnterKeyEvent(), new QTerminateAction());
if (isset($this->arrMapFields[$intTotalCount - 1])) {
unset($this->arrMapFields[$intTotalCount - 1]);
}
$this->btnRemoveArray[$intTotalCount - 1] = $btnRemove;
}
开发者ID:proxymoron,项目名称:tracmor,代码行数:30,代码来源:contact_import.php
示例15: dtgRoleEntityQtypeCustomFieldAuthorization_EditLinkColumn_Render
public function dtgRoleEntityQtypeCustomFieldAuthorization_EditLinkColumn_Render(RoleEntityQtypeCustomFieldAuthorization $objRoleEntityQtypeCustomFieldAuthorization)
{
$strControlId = 'btnEdit' . $this->dtgRoleEntityQtypeCustomFieldAuthorization->CurrentRowIndex;
$btnEdit = $this->objForm->GetControl($strControlId);
if (!$btnEdit) {
$btnEdit = new QButton($this->dtgRoleEntityQtypeCustomFieldAuthorization, $strControlId);
$btnEdit->Text = QApplication::Translate('Edit');
$btnEdit->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnEdit_Click'));
}
$btnEdit->ActionParameter = $objRoleEntityQtypeCustomFieldAuthorization->RoleEntityQtypeCustomFieldAuthorizationId;
return $btnEdit->Render(false);
}
开发者ID:heshuai64,项目名称:einv2,代码行数:12,代码来源:RoleEntityQtypeCustomFieldAuthorizationListPanelBase.class.php
示例16: RenderSelect
public function RenderSelect(Person $objPerson, $intRow)
{
$strControlId = 'chkSelected' . $objPerson->Id . $intRow;
$btnSelect = $this->objForm->GetControl($strControlId);
if (!$btnSelect) {
$btnSelect = new QButton($this->dtgPeople, $strControlId);
$btnSelect->Text = 'Select';
$btnSelect->CssClass = 'primary';
$btnSelect->ActionParameter = $objPerson->Id;
$btnSelect->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'pxySelect_Click'));
$btnSelect->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnSelect_Click'));
}
return $btnSelect->Render(false);
}
开发者ID:alcf,项目名称:chms,代码行数:14,代码来源:StewardshipSelectPersonDialogBox.class.php
示例17: RemoveAssetModelsColumn_Render
public function RemoveAssetModelsColumn_Render(AssetCustomFieldAssetModel $objAssetCustomFieldAssetModel)
{
$strControlId = 'btnAssetModelRemove' . $objAssetCustomFieldAssetModel->AssetModelId;
$btnAssetModelRemove = new QButton($this->dtgAssetModels);
$btnAssetModelRemove->Text = 'Remove';
$btnAssetModelRemove->ActionParameter = $objAssetCustomFieldAssetModel->AssetModelId;
$btnAssetModelRemove->AddAction(new QClickEvent(), new QAjaxAction('btnAssetModelRemove_Click'));
$btnAssetModelRemove->AddAction(new QEnterKeyEvent(), new QAjaxAction('btnAssetModelRemove_Click'));
$btnAssetModelRemove->AddAction(new QEnterKeyEvent(), new QTerminateAction());
$btnAssetModelRemove->CausesValidation = false;
return $btnAssetModelRemove->RenderWithError(false);
}
开发者ID:proxymoron,项目名称:tracmor,代码行数:12,代码来源:custom_field_edit.php
示例18: RemoveColumn_Render
public function RemoveColumn_Render(CustomFieldValue $objCustomFieldValue)
{
$strControlId = 'btnRemove' . $objCustomFieldValue->CustomFieldValueId;
$btnRemove = $this->GetControl($strControlId);
if (!$btnRemove) {
// Create the Remove button for this row in the DataGrid
// Use ActionParameter to specify the ID of the asset
$btnRemove = new QButton($this->dtgValue, $strControlId);
$btnRemove->Text = 'Remove';
$btnRemove->ActionParameter = $objCustomFieldValue->CustomFieldValueId;
$btnRemove->AddAction(new QClickEvent(), new QAjaxAction('btnRemove_Click'));
$btnRemove->AddAction(new QEnterKeyEvent(), new QAjaxAction('btnRemove_Click'));
$btnRemove->AddAction(new QEnterKeyEvent(), new QTerminateAction());
$btnRemove->CausesValidation = false;
}
return $btnRemove->RenderWithError(false);
}
开发者ID:brustj,项目名称:tracmor,代码行数:17,代码来源:custom_field_edit.php
示例19: Form_Create
protected function Form_Create()
{
$strServerActionJsParam = "";
$this->btnSubmit = new QButton($this);
$this->btnSubmit->Text = "ServerAction Submit";
$this->SubmitResult = new QPanel($this);
// Slider
$this->Slider = new QSlider($this);
$this->Slider->Max = 1250;
$this->Slider->AddAction(new MyQSlider_ChangeEvent(), new QAjaxAction('onSlide'));
$this->SliderResult = new QPanel($this);
// Resizable
$this->Resizable = new QPanel($this);
$this->Resizable->CssClass = 'resizable';
$this->Resizable->Resizable = true;
$this->ResizableResult = new QPanel($this);
$strJsParam = '{
"width": $j("#' . $this->Resizable->ControlId . '").width(),
"height": $j("#' . $this->Resizable->ControlId . '").height()
}';
$this->Resizable->AddAction(new QResizable_StopEvent(), new QAjaxAction("onResize", "default", null, $strJsParam));
$this->ResizableResult = new QPanel($this);
$strServerActionJsParam = '{"resizable": ' . $strJsParam . ', ';
// Selectable
$this->Selectable = new QSelectable($this);
$this->Selectable->AutoRenderChildren = true;
$this->Selectable->CssClass = 'selectable';
for ($i = 1; $i <= 5; ++$i) {
$pnl = new QPanel($this->Selectable);
$pnl->Text = 'Item ' . $i;
$pnl->CssClass = 'selitem';
}
$this->Selectable->Filter = 'div.selitem';
/*
* if your objects to return get more complex you can define a javascript function that returns your
* object. the essential thing is the ".call()", this executes the function that you have just defined
* and returns your object.
* In this example a function is uesd to temporary store jquery's search result for selected items,
* because it is needed twice. then the ids are stored to objRet.ids as a comma-separated string and
* the contents of the selected items are stored to objRet.content as an array.
*
*/
$this->SelectableResult = new QPanel($this);
$strJsParam = 'function() {
objRet = new Object();
selection = $j("#' . $this->Selectable->ControlId . '")
.find(".ui-selected");
objRet.ids = selection.map(function(){
return this.id;
}).get()
.join(",");
objRet.content = selection.map(function() {
return $j(this).html();
}).get();
return objRet;
}.call()';
$this->Selectable->AddAction(new QSelectable_StopEvent(), new QAjaxAction("onSelect", "default", null, $strJsParam));
$strServerActionJsParam .= '"selectable": ' . $strJsParam . ', ';
// Sortable
$this->Sortable = new QSortable($this);
$this->Sortable->AutoRenderChildren = true;
$this->Sortable->CssClass = 'sortable';
for ($i = 1; $i <= 5; ++$i) {
$pnl = new QPanel($this->Sortable);
$pnl->Text = 'Item ' . $i;
$pnl->CssClass = 'sortitem';
}
$this->Sortable->Items = 'div.sortitem';
$this->SortableResult = new QPanel($this);
$strJsParam = '$j("#' . $this->Sortable->ControlId . '").
find("div.sortitem").
map(function() {
return $j(this).html()
}).get()';
$this->Sortable->AddAction(new QSortable_UpdateEvent(), new QAjaxAction("onSort", "default", null, $strJsParam));
$strServerActionJsParam .= '"sortable": ' . $strJsParam . '}';
//a second Sortable that can receive items from the first Sortable
//when an item is dragged over from the first sortable an receive event is triggered
$this->Sortable2 = new QSortable($this);
$this->Sortable2->AutoRenderChildren = true;
$this->Sortable2->CssClass = 'sortable';
for ($i = 6; $i <= 10; ++$i) {
$pnl = new QPanel($this->Sortable2);
$pnl->Text = 'Item ' . $i;
$pnl->CssClass = 'sortitem';
}
$this->Sortable2->Items = 'div.sortitem';
//allow dragging from Sortable to Sortable2
$this->Sortable->ConnectWith = '#' . $this->Sortable2->ControlId;
//enable the following line to allow dragging Sortable2 child items to the Sortable list
// $this->Sortable2->ConnectWith = '#' . $this->Sortable->ControlId;
//using a QJsClosure as the ActionParameter for Sortable2 to return a Js object
//the ActionParameter is used for every ajax / server action defined on this control
$this->Sortable2->ActionParameter = new QJsClosure('return $j("#' . $this->Sortable2->ControlId . '")
.find("div.sortitem")
.map(function() {
return $j(this).html()
}).get();');
//(the list of names from the containing items) is returned for the following two Ajax Actions
$this->Sortable2->AddAction(new QSortable_UpdateEvent(), new QAjaxAction("onSort2"));
//.........这里部分代码省略.........
开发者ID:tomVertuoz,项目名称:framework,代码行数:101,代码来源:js_return_param_example.php
示例20: render_btnRecordDelete
public function render_btnRecordDelete($parControl, Address $objRecord)
{
++$this->tempdelete;
if ($objRecord->Id == $this->intEditAddressId || $this->intEditAddressId == -1 && !$objRecord->Id) {
return null;
} else {
$strControlId = 'btnRecordDelete' . $objRecord->Id . 'dlt' . $this->tempdelete;
if (!($objControl = $this->Form->GetControl($strControlId))) {
$objControl = new QButton($parControl, $strControlId);
$objControl->Text = 'Delete';
$objControl->CssClass = 'inputbutton';
$objControl->ActionParameter = $objRecord->Id;
$objControl->AddAction(new QClickEvent(), new QConfirmAction('Are you sure ?'));
$objControl->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'btnRecordDelete_Click', $this->dtgAddresses->WaitIcon));
return $objControl->Render(false);
}
}
}
开发者ID:tomVertuoz,项目名称:framework,代码行数:18,代码来源:AddressListPanel.class.php
注:本文中的QButton类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论