[CLOSED] i wana handle my web service when replay with {d:null}

  1. #1

    [CLOSED] i wana handle my web service when replay with {d:null}

    i wana set at my Dataview a specific string when my web service return to my store {d:null}, perhaps below code will help you:

    the store:

     <ext:Store ID="ProspectingStore" runat="server">
            <Proxy>
                <ext:HttpProxy DisableCaching="true" Json="true" Method="Post" Url="http://localhost:65000/UtilitiesWebService.asmx/strGetDelearProspecting">
                </ext:HttpProxy>
            </Proxy>
            <BaseParams>
                <ext:Parameter Name="delarLocationID">
                </ext:Parameter>
            </BaseParams>
            <Reader>
                <ext:JsonReader Root="d.Data" TotalProperty="d.TotalRecords">
                    <Fields>
                        <ext:RecordField Name="PublishDate" Type="Date" />
                        <ext:RecordField Name="ProfileImage" />
                        <ext:RecordField Name="AuthorName" />
                        <ext:RecordField Name="Content" />
                        <ext:RecordField Name="AuthorScreenName" />
                        <ext:RecordField Name="ProspectID" />
                        <ext:RecordField Name="FacebookDateTimeStyle" />
                    </Fields>
                </ext:JsonReader>
            </Reader>
            <Listeners>
                <LoadException Handler="var e = e || {message: response.responseText};" />
            </Listeners>
        </ext:Store>
    the dataview:

     <ext:Panel ID="ImagePanel" runat="server" Cls="images-view" Frame="true" AutoHeight="true"
                        Width="400" Collapsible="false" Layout="Fit" HideLabel="true">
                        <Items>
                            <ext:DataView ID="ImageView" runat="server" StoreID="ProspectingStore" AutoHeight="true" Width="400"
                                MultiSelect="true" OverClass="x-view-over" ItemSelector="div.thumb-wrap" EmptyText="No images to display">
                                <Template ID="Template2" runat="server">
                                    <Html>
                                        <tpl for=".">
                                        <div class="thumb-wrap" id="{AuthorName}">
                                        <div class="thumb"><img src="{ProfileImage}" title="{AuthorName}"></div>
                                        <span class="x-editable">{Content}  {PublishDate}</span>
                                        <span class="x-editable">{FacebookDateTimeStyle}</span>
                                    </div>
                         </tpl>
                                        <div class="x-clear"></div>
                                    </Html>
                                </Template>
                            </ext:DataView>
                        </Items>
                    </ext:Panel>
    Last edited by Daniil; Dec 24, 2010 at 5:28 AM. Reason: [CLOSED]
  2. #2
    Hi,

    Well, it can look something like this:

    Example
    <ext:Store runat="server" ShowWarningOnFailure="false" ...>
        <Proxy>
            <ext:HttpProxy Json="true" Method="POST" Url="PlantJsonService.asmx/PlantsPaging" />
        </Proxy>
        <Listeners>
            <LoadException Handler="if (response.responseText=='{&quot;d&quot;:null}') { alert('Grid is  empty!'); }" />
        </Listeners>
        
        ...
        
    </ext:Store>
  3. #3

    still need support.

    thanks man , but i still need to set the HTML of the Dataview i have not to show an alert.
  4. #4
    Hi,

    Could you please provide us with a sample/test project to reproduce?
  5. #5
    Hi,

    thanks man , but i still need to set the HTML of the Dataview i have not to show an alert.
    Try the following code
    DataView1.update("There is no data");
  6. #6

    strill not working.

    it is not working , can i write to content section of data view directly.
  7. #7
    Hi,

    For me that code updates DataView content correctly (i see the text).
    Please provide test sample which demonstrates how you try to update DataView

    Why do you return null from json webservice, may be return empty collection (collection without data), in this case empty text can be applied automatically if EmptyText is defined

    emptyText : String
    The text to display in the view when there is no data to display (defaults to '').
  8. #8

    thanks man...

    it is done , thanks alot , it is done through the emptystring...

Similar Threads

  1. Replies: 0
    Last Post: Dec 01, 2011, 6:43 AM
  2. How to handle events
    By costab in forum 1.x Help
    Replies: 2
    Last Post: Apr 26, 2011, 11:09 PM
  3. [CLOSED] Is it possible to handle doubleclick event on a tab
    By anup in forum 1.x Legacy Premium Help
    Replies: 17
    Last Post: Feb 02, 2011, 6:47 PM
  4. [CLOSED] How to deal with a null date in a JSON Web Service?
    By dev in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 31, 2010, 11:51 PM
  5. Replies: 1
    Last Post: Jun 08, 2010, 11:38 AM

Tags for this Thread

Posting Permissions