I have textinput within list itemrenderer like
main.mxml
<s:List
id="videoAttachmentsList"
itemRenderer.normalView="com.engage.discussion.attachment.renderers.VideoAttachmentRenderer"
>
<mx:button label="add" click=addevent(Event) />
VideoAttachmentRenderer.as
<TextInput styleName="commonTextInput"
prompt="Enter a video header"
id="headerText"
x="75" width="185" height="21"
bottom="5"
fontSize="10"
maxChars="30"/>
<fx:Declarations>
<mx:StringValidator source="{headerText}" property="text" required="true" maxLength="30" requiredFieldError="Please enter video header"/>
</fx:Declarations>
My doubts is when i click add button on (main.mxml) that time need validate headerText(Textinput)(VideoAttachmentRenderer.as) . is it possible to validate string withing itemRenderer. could u give any guidance ?
override the set data method and trigger the validation in there
Related
Does it have any way to make a custom path for some Show buttons?
I have a ReferecenManyField that has 2 types of components underneath and I want to redirect to the Show page of each of these components.
In my CollectionShow I have
<Show title={<CollectionTitle />} actions={<CollectionShowActions />} {...props}>
<SimpleShowLayout>
...
<ReferenceManyField label="Itens" target="collection_id" reference="collection_items">
<Datagrid bodyOptions={{ showRowHover: true }}>
<TextField source="id" />
<TextField label="Tipo" source="collectionable_type" />
<TextField label="Nome" source="collectionable.name" sortable={false} />
<TextField label="Privacidade" source="collectionable.privacy" sortable={false} />
<ShowButton />
</Datagrid>
</ReferenceManyField>
... where my collectionable_type can be either another Collection or a LearningObject.
Is there any way to make a customable URL for the ShowButton?
Maybe something like:
<ShowButton basePath={"/${collectionable_type}/${collectionable.id}"} />
The <ShowButton /> component is dedicated to creating links to a show view managed by admin-on-rest.
To make a customable URL in your Datagrid, you should create a dedicated field component as explained in the documentation Writing Your Own Field Component
I am looking for a way to allow Show to be able to use a Datagrid on the show page. I want to be able to click on the show button and when the show page appears, I want to be able to take data and make another grid using Datagrid or something similar. Any Ideas how this is done?
it seems show page take 1 record and render its. on show page you can place related records with current. for example news can related with one project and one project has many news. code below get from api all related news and render its as a table. hope it helps you
export const ProjectShow = ({ ...props }) => (
<Show title={<ProjectTitle />} {...props}>
<SimpleShowLayout>
<ReferenceManyField label="News" reference="news" target="project_id">
<Datagrid>
<TextField source="id" />
<TextField source="title" />
<DateField source="created_at" showTime />
<DateField source="updated_at" showTime />
<EditButton />
</Datagrid>
</ReferenceManyField>
</SimpleShowLayout>
</Show>
);
don't remember place in App.js line:
<Resource name="projects" ...another actions... show={ProjectShow} />
I am trying to find a way to bind a data table to a tab panel (within a tabcontainer and template) without doing it on page_init or page_load. OR Binding a data table to a gridview then binding that gridview to the tab panel. I know how to bind a data table to a gridview so that's the easy part. I have to be able to - on click of a button - add or create multiple tabs in that tab container.
I want the user to be able to click a button, run some queries and then make the tab container visible and bind the data from a data table to a panel at that time (then the panel to the tab container). Do this multiple times.
Can someone provide an example or explain how I can accomplsih this? Is Update Panel my answer and where can I find some good examples?
UPDATE
I found that it was very easy to bind data to a gridview within Ajax tabs. Of course you needed you script manager ajax reference declared in the asp page and web.config file. You also need to add the ajax css style to an existing style sheet. i tried using a seperate one and it didn't work.
ASP HTML
<AjaxToolkit:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"
Visible="false" ScrollBars="Both"
CssClass="Tab2" Width="1326px" Height="464px" >
<AjaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="Empty" Enabled="true" ScrollBars="Both" CssClass="Tab2">
<ContentTemplate>
<div style="overflow:auto;width:1287px; height: 418px;">
<font color="white" size="1" face="Verdana">
<asp:GridView ID="SalesOrderView1" runat="server" BackColor="White" BorderColor="#DEDFDE"visible="False"BorderStyle="None" BorderWidth="1px"
CellPadding="4" ForeColor="Black"
GridLines="Vertical" HorizontalAlign="Center">
<AlternatingRowStyle BackColor="White" />
<FooterStyle BackColor="#CCCC99" />
<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
<RowStyle BackColor="#F7F7DE" />
<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FBFBF2" />
<SortedAscendingHeaderStyle BackColor="#848384" />
<SortedDescendingCellStyle BackColor="#EAEAD3" />
<SortedDescendingHeaderStyle BackColor="#575357" />
</asp:GridView>
</div>
</font>
</ContentTemplate>
</AjaxToolkit:TabPanel>
<AjaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="Empty" ScrollBars="Both" CssClass="Tab2">
<ContentTemplate >
</AjaxToolkit:TabContainer>
C# Code to bind data to the gridview on click button event.
SalesOrderView1.Visible = true;
TabPanel1.Visible = true;
TabPanel1.HeaderText = Order_List[multi_order_count];
Hello I am using Telerik Rad Controls for the DataGrid view...
I want to display only some required columns in the DataGrid.. so I used this code
<telerik:RadGridView.Columns>
<telerik:GridViewColumn Header="Market Code" />
<telerik:GridViewColumn Header="Market Name" />
</telerik:RadGridView.Columns>
But I was not able to set the binding.. I was not able to set the DataMemberBinding to the column...
It says the property was not found in the GridViewColumn....
<riaControls:DomainDataSource AutoLoad="True"
Height="0"
LoadedData="mKT_MSTRDomainDataSource_LoadedData_1"
x:Name="mKT_MSTRDomainDataSource"
QueryName="GetMKT_MSTRQuery" Width="0" >
<riaControls:DomainDataSource.DomainContext>
<my:GNDataDomainContext />
</riaControls:DomainDataSource.DomainContext>
</riaControls:DomainDataSource>
<telerik:RadGridView Grid.Column="1" AutoGenerateColumns="False"
ItemsSource="{Binding Data,
ElementName=mKT_MSTRDomainDataSource}"
x:Name="mKT_MSTRRadGridView" Width="Auto"
Canvas.Left="290" Height="300" >
<telerik:RadGridView.Columns>
<telerik:GridViewColumn Header="Market Code" DataMemberBinding="" />
<telerik:GridViewColumn Header="Market Name" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
Can anyone help me where am I making mistake... please
You need to choose an appropriate type of column for binding, e.g. GridViewDataColumn, etc. depending on your data type. You can see the list of pre-defined column types here.
You then need to bind the columns to the data you want to display, with the DataMemberBinding attribute:
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="Market Code" DataMemberBinding="{Binding MarketCode}" />
<telerik:GridViewDataColumn Header="Market Name" DataMemberBinding="{Binding MarketName}"/>
</telerik:RadGridView.Columns>
where MarketCode and MarketName are properties on your data records
When deleting a row in jqgrid, I would like to return a custom error text when server returns 500 error. I am using jqGrid for ASP.NET, and the grid does not seem to have an "loadError" event
Has anyone done this?
jqGrid is defined like this
<trirand:JQGrid runat="server" ID="Jqgrid" ShrinkToFit="true" Width="900px" Height="500" PagerSettings-PageSize="20" PagerSettings-PageSizeOptions="[20,50,100]" OnSearching="JQGrid_Searching" OnSorting="JQGrid_Sorting" OnRowEditing="JQGrid_RowEditing" OnRowDeleting="JQGrid_RowDeleting">
<Columns>
<trirand:JQGridColumn DataField="ID" PrimaryKey="True" Width="40" Visible="False" />
<trirand:JQGridColumn DataField="NAME" SearchType="DropDown" Width="55" SearchControlID="ddlNameFilter"
HeaderText="Name" Editable="true">
<EditClientSideValidators>
<trirand:RequiredValidator />
</EditClientSideValidators>
</trirand:JQGridColumn>
<trirand:JQGridColumn DataField="DESCR" SearchType="DropDown" Width="55" SearchControlID="ddlDescrFilter"
Searchable="True" HeaderText="Descr" Editable="true">
<EditClientSideValidators>
<trirand:RequiredValidator />
</EditClientSideValidators>
</trirand:JQGridColumn>
<trirand:JQGridColumn HeaderText=" " EditActionIconsColumn="true" Width="50" EditActionIconsEditEnabled="false"
CssClass="clickable" />
</Columns>
<ClientSideEvents LoadComplete="loadComplete" ColumnSort="columnSort" RowDoubleClick="editRow">
</ClientSideEvents>
<ToolBarSettings ShowSearchToolBar="True" ToolBarPosition="TopAndBottom">
</ToolBarSettings>
<PagerSettings NoRowsMessage="No rows to display" />
<ExportSettings ExportDataRange="All" />
</trirand:JQGrid>
The callback loadError are used to process errors during filling/loading of the grid. Form editing methods like delGridRow supports errorTextFormat callback. So is you use navGrid you should define errorTextFormat callback as the method of prmDel parameter of navGrid.
Additionally I would recommend you to use [HandleJsonException] instead of [HandleError] in case of usage ASP.NET MVC (see the answer for details). In other ASP.NET applications you can define the error handler Application_Error in Global.asax.cs (see the answer). The usage of such handles will simplify you the analyse of the error server response inside of errorTextFormat callback because the error information will be returned as JSON.